Unverified Commit d121310b authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #1497

Stop handling continuation frames as control frames
parents c0618601 4f24f8bf
...@@ -59,7 +59,7 @@ struct CAF_NET_EXPORT rfc6455 { ...@@ -59,7 +59,7 @@ struct CAF_NET_EXPORT rfc6455 {
static ptrdiff_t decode_header(const_byte_span data, header& hdr); static ptrdiff_t decode_header(const_byte_span data, header& hdr);
static constexpr bool is_control_frame(uint8_t opcode) noexcept { static constexpr bool is_control_frame(uint8_t opcode) noexcept {
return opcode != text_frame && opcode != binary_frame; return opcode > binary_frame;
} }
}; };
......
...@@ -77,8 +77,7 @@ ptrdiff_t framing::consume(byte_span buffer, byte_span) { ...@@ -77,8 +77,7 @@ ptrdiff_t framing::consume(byte_span buffer, byte_span) {
} }
// Handle control frames first, since these may not me fragmented, // Handle control frames first, since these may not me fragmented,
// and can arrive between regular message fragments. // and can arrive between regular message fragments.
if (detail::rfc6455::is_control_frame(hdr.opcode) if (detail::rfc6455::is_control_frame(hdr.opcode)) {
&& hdr.opcode != detail::rfc6455::continuation_frame) {
if (!hdr.fin) { if (!hdr.fin) {
abort_and_shutdown(sec::protocol_error, abort_and_shutdown(sec::protocol_error,
"received a fragmented WebSocket control message"); "received a fragmented WebSocket control message");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment