Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
2149ac7ed6 |
@ -132,7 +132,6 @@ To check the performance of a websocket library, you can look at the [autoroute]
|
|||||||
| Windows | Disabled | None | [![Build2][5]][0] |
|
| Windows | Disabled | None | [![Build2][5]][0] |
|
||||||
| UWP | Disabled | None | [![Build2][6]][0] |
|
| UWP | Disabled | None | [![Build2][6]][0] |
|
||||||
| Linux | OpenSSL | Address Sanitizer | [![Build2][7]][0] |
|
| Linux | OpenSSL | Address Sanitizer | [![Build2][7]][0] |
|
||||||
| Mingw | Disabled | None | [![Build2][8]][0] |
|
|
||||||
|
|
||||||
* ASAN fails on Linux because of a known problem, we need a
|
* ASAN fails on Linux because of a known problem, we need a
|
||||||
* Some tests are disabled on Windows/UWP because of a pathing problem
|
* Some tests are disabled on Windows/UWP because of a pathing problem
|
||||||
@ -146,5 +145,4 @@ To check the performance of a websocket library, you can look at the [autoroute]
|
|||||||
[5]: https://github.com/machinezone/IXWebSocket/workflows/windows/badge.svg
|
[5]: https://github.com/machinezone/IXWebSocket/workflows/windows/badge.svg
|
||||||
[6]: https://github.com/machinezone/IXWebSocket/workflows/uwp/badge.svg
|
[6]: https://github.com/machinezone/IXWebSocket/workflows/uwp/badge.svg
|
||||||
[7]: https://github.com/machinezone/IXWebSocket/workflows/linux_asan/badge.svg
|
[7]: https://github.com/machinezone/IXWebSocket/workflows/linux_asan/badge.svg
|
||||||
[8]: https://github.com/machinezone/IXWebSocket/workflows/unittest_windows_gcc/badge.svg
|
|
||||||
|
|
||||||
|
@ -2,14 +2,6 @@
|
|||||||
|
|
||||||
All changes to this project will be documented in this file.
|
All changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [11.2.8] - 2021-06-03
|
|
||||||
|
|
||||||
(websocket client + server) WebSocketMessage class tweak to fix unsafe patterns
|
|
||||||
|
|
||||||
## [11.2.7] - 2021-05-27
|
|
||||||
|
|
||||||
(websocket server) Handle and accept firefox browser special upgrade value (keep-alive, Upgrade)
|
|
||||||
|
|
||||||
## [11.2.6] - 2021-05-18
|
## [11.2.6] - 2021-05-18
|
||||||
|
|
||||||
(Windows) move EINVAL (re)definition from IXSocket.h to IXNetSystem.h (fix #289)
|
(Windows) move EINVAL (re)definition from IXSocket.h to IXNetSystem.h (fix #289)
|
||||||
|
@ -137,7 +137,7 @@ namespace ix
|
|||||||
{
|
{
|
||||||
contentLength = std::stoi(headers["Content-Length"]);
|
contentLength = std::stoi(headers["Content-Length"]);
|
||||||
}
|
}
|
||||||
catch (const std::exception&)
|
catch(const std::exception&)
|
||||||
{
|
{
|
||||||
return std::make_tuple(
|
return std::make_tuple(
|
||||||
false, "Error parsing HTTP Header 'Content-Length'", httpRequest);
|
false, "Error parsing HTTP Header 'Content-Length'", httpRequest);
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
const std::string emptyMsg;
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
OnTrafficTrackerCallback WebSocket::_onTrafficTrackerCallback = nullptr;
|
OnTrafficTrackerCallback WebSocket::_onTrafficTrackerCallback = nullptr;
|
||||||
@ -44,7 +38,7 @@ namespace ix
|
|||||||
[this](uint16_t code, const std::string& reason, size_t wireSize, bool remote) {
|
[this](uint16_t code, const std::string& reason, size_t wireSize, bool remote) {
|
||||||
_onMessageCallback(
|
_onMessageCallback(
|
||||||
ix::make_unique<WebSocketMessage>(WebSocketMessageType::Close,
|
ix::make_unique<WebSocketMessage>(WebSocketMessageType::Close,
|
||||||
emptyMsg,
|
"",
|
||||||
wireSize,
|
wireSize,
|
||||||
WebSocketErrorInfo(),
|
WebSocketErrorInfo(),
|
||||||
WebSocketOpenInfo(),
|
WebSocketOpenInfo(),
|
||||||
@ -223,7 +217,7 @@ namespace ix
|
|||||||
|
|
||||||
_onMessageCallback(ix::make_unique<WebSocketMessage>(
|
_onMessageCallback(ix::make_unique<WebSocketMessage>(
|
||||||
WebSocketMessageType::Open,
|
WebSocketMessageType::Open,
|
||||||
emptyMsg,
|
"",
|
||||||
0,
|
0,
|
||||||
WebSocketErrorInfo(),
|
WebSocketErrorInfo(),
|
||||||
WebSocketOpenInfo(status.uri, status.headers, status.protocol),
|
WebSocketOpenInfo(status.uri, status.headers, status.protocol),
|
||||||
@ -257,7 +251,7 @@ namespace ix
|
|||||||
|
|
||||||
_onMessageCallback(
|
_onMessageCallback(
|
||||||
ix::make_unique<WebSocketMessage>(WebSocketMessageType::Open,
|
ix::make_unique<WebSocketMessage>(WebSocketMessageType::Open,
|
||||||
emptyMsg,
|
"",
|
||||||
0,
|
0,
|
||||||
WebSocketErrorInfo(),
|
WebSocketErrorInfo(),
|
||||||
WebSocketOpenInfo(status.uri, status.headers),
|
WebSocketOpenInfo(status.uri, status.headers),
|
||||||
@ -344,7 +338,7 @@ namespace ix
|
|||||||
connectErr.http_status = status.http_status;
|
connectErr.http_status = status.http_status;
|
||||||
|
|
||||||
_onMessageCallback(ix::make_unique<WebSocketMessage>(WebSocketMessageType::Error,
|
_onMessageCallback(ix::make_unique<WebSocketMessage>(WebSocketMessageType::Error,
|
||||||
emptyMsg,
|
"",
|
||||||
0,
|
0,
|
||||||
connectErr,
|
connectErr,
|
||||||
WebSocketOpenInfo(),
|
WebSocketOpenInfo(),
|
||||||
|
@ -204,9 +204,6 @@ namespace ix
|
|||||||
// Check the value of the connection field
|
// Check the value of the connection field
|
||||||
// Some websocket servers (Go/Gorilla?) send lowercase values for the
|
// Some websocket servers (Go/Gorilla?) send lowercase values for the
|
||||||
// connection header, so do a case insensitive comparison
|
// connection header, so do a case insensitive comparison
|
||||||
//
|
|
||||||
// See https://github.com/apache/thrift/commit/7c4bdf9914fcba6c89e0f69ae48b9675578f084a
|
|
||||||
//
|
|
||||||
if (!insensitiveStringCompare(headers["connection"], "Upgrade"))
|
if (!insensitiveStringCompare(headers["connection"], "Upgrade"))
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
@ -299,8 +296,7 @@ namespace ix
|
|||||||
return sendErrorResponse(400, "Missing Upgrade header");
|
return sendErrorResponse(400, "Missing Upgrade header");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!insensitiveStringCompare(headers["upgrade"], "WebSocket") &&
|
if (!insensitiveStringCompare(headers["upgrade"], "WebSocket"))
|
||||||
headers["Upgrade"] != "keep-alive, Upgrade") // special case for firefox
|
|
||||||
{
|
{
|
||||||
return sendErrorResponse(400,
|
return sendErrorResponse(400,
|
||||||
"Invalid Upgrade header, "
|
"Invalid Upgrade header, "
|
||||||
|
@ -42,18 +42,6 @@ namespace ix
|
|||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Deleted overload to prevent binding `str` to a temporary, which would cause
|
|
||||||
* undefined behavior since class members don't extend lifetime beyond the constructor call.
|
|
||||||
*/
|
|
||||||
WebSocketMessage(WebSocketMessageType t,
|
|
||||||
std::string&& s,
|
|
||||||
size_t w,
|
|
||||||
WebSocketErrorInfo e,
|
|
||||||
WebSocketOpenInfo o,
|
|
||||||
WebSocketCloseInfo c,
|
|
||||||
bool b = false) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using WebSocketMessagePtr = std::unique_ptr<WebSocketMessage>;
|
using WebSocketMessagePtr = std::unique_ptr<WebSocketMessage>;
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "11.2.8"
|
#define IX_WEBSOCKET_VERSION "11.2.6"
|
||||||
|
Reference in New Issue
Block a user