Fragmentation: for sent messages which are compressed, the continuation fragments should not have the rsv1 bit set (fix all autobahn tests for zlib compression 12.X)
Websocket Server / do a case insensitive string search when looking for an Upgrade header whose value is websocket. (some client use WebSocket with some upper-case characters)
This commit is contained in:
parent
f25b2af6eb
commit
cae23c764f
@ -1 +1 @@
|
|||||||
5.1.9
|
5.2.0
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [5.2.0] - 2019-09-04
|
||||||
|
|
||||||
|
- Fragmentation: for sent messages which are compressed, the continuation fragments should not have the rsv1 bit set (fix all autobahn tests for zlib compression 12.X)
|
||||||
|
- Websocket Server / do a case insensitive string search when looking for an Upgrade header whose value is websocket. (some client use WebSocket with some upper-case characters)
|
||||||
|
|
||||||
## [5.1.9] - 2019-09-03
|
## [5.1.9] - 2019-09-03
|
||||||
|
|
||||||
- ws autobahn / report progress with spdlog::info to get timing info
|
- ws autobahn / report progress with spdlog::info to get timing info
|
||||||
|
@ -295,7 +295,7 @@ namespace ix
|
|||||||
return sendErrorResponse(400, "Missing Sec-WebSocket-Key value");
|
return sendErrorResponse(400, "Missing Sec-WebSocket-Key value");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers["upgrade"] != "websocket")
|
if (!insensitiveStringCompare(headers["upgrade"], "WebSocket"))
|
||||||
{
|
{
|
||||||
return sendErrorResponse(400, "Invalid or missing Upgrade header");
|
return sendErrorResponse(400, "Invalid or missing Upgrade header");
|
||||||
}
|
}
|
||||||
@ -326,6 +326,7 @@ namespace ix
|
|||||||
ss << "Sec-WebSocket-Accept: " << std::string(output) << "\r\n";
|
ss << "Sec-WebSocket-Accept: " << std::string(output) << "\r\n";
|
||||||
ss << "Upgrade: websocket\r\n";
|
ss << "Upgrade: websocket\r\n";
|
||||||
ss << "Connection: Upgrade\r\n";
|
ss << "Connection: Upgrade\r\n";
|
||||||
|
ss << "Server: " << userAgent() << "\r\n";
|
||||||
|
|
||||||
// Parse the client headers. Does it support deflate ?
|
// Parse the client headers. Does it support deflate ?
|
||||||
std::string header = headers["sec-websocket-extensions"];
|
std::string header = headers["sec-websocket-extensions"];
|
||||||
|
@ -866,6 +866,8 @@ namespace ix
|
|||||||
message_end = compressedMessage.end();
|
message_end = compressedMessage.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_txbuf.reserve(wireSize);
|
||||||
|
|
||||||
// Common case for most message. No fragmentation required.
|
// Common case for most message. No fragmentation required.
|
||||||
if (wireSize < kChunkSize)
|
if (wireSize < kChunkSize)
|
||||||
{
|
{
|
||||||
@ -953,8 +955,9 @@ namespace ix
|
|||||||
header[0] |= 0x80;
|
header[0] |= 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This bit indicate that the frame is compressed
|
// The rsv1 bit indicate that the frame is compressed
|
||||||
if (compress)
|
// continuation opcodes should not set it. Autobahn 12.2.10 and others 12.X
|
||||||
|
if (compress && type != wsheader_type::CONTINUATION)
|
||||||
{
|
{
|
||||||
header[0] |= 0x40;
|
header[0] |= 0x40;
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "5.1.9"
|
#define IX_WEBSOCKET_VERSION "5.2.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user