mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
improve frame_is_binary setting
Gregory Junker <ggjunker@gmail.com> noticed the binary flag is not getting set right, or at all on client side. This should improve matters. Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
acbaee649a
commit
10601c1fba
2 changed files with 16 additions and 3 deletions
|
@ -139,7 +139,14 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c)
|
|||
wsi->opcode = c & 0xf;
|
||||
wsi->rsv = (c & 0x70);
|
||||
wsi->final = !!((c >> 7) & 1);
|
||||
|
||||
switch (wsi->opcode) {
|
||||
case LWS_WS_OPCODE_07__TEXT_FRAME:
|
||||
wsi->frame_is_binary = 0;
|
||||
break;
|
||||
case LWS_WS_OPCODE_07__BINARY_FRAME:
|
||||
wsi->frame_is_binary = 1;
|
||||
break;
|
||||
}
|
||||
wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN;
|
||||
break;
|
||||
|
||||
|
|
|
@ -792,7 +792,14 @@ handle_first:
|
|||
wsi->opcode = c & 0xf;
|
||||
wsi->rsv = (c & 0x70);
|
||||
wsi->final = !!((c >> 7) & 1);
|
||||
|
||||
switch (wsi->opcode) {
|
||||
case LWS_WS_OPCODE_07__TEXT_FRAME:
|
||||
wsi->frame_is_binary = 0;
|
||||
break;
|
||||
case LWS_WS_OPCODE_07__BINARY_FRAME:
|
||||
wsi->frame_is_binary = 1;
|
||||
break;
|
||||
}
|
||||
wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN;
|
||||
break;
|
||||
|
||||
|
@ -1071,7 +1078,6 @@ spill:
|
|||
|
||||
case LWS_WS_OPCODE_07__TEXT_FRAME:
|
||||
case LWS_WS_OPCODE_07__BINARY_FRAME:
|
||||
wsi->frame_is_binary = wsi->opcode == LWS_WS_OPCODE_07__BINARY_FRAME;
|
||||
case LWS_WS_OPCODE_07__CONTINUATION:
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue