mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
fix frgmented server reply
Server handshake reply might not come in one packet as pointed out by Pavel Borzenkov. This replaces his fix with one directly in the packet state machine. Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
72c34321d3
commit
27a0b91333
1 changed files with 8 additions and 5 deletions
|
@ -1364,11 +1364,14 @@ issue_hdr:
|
|||
for (n = 0; n < len; n++)
|
||||
libwebsocket_parse(wsi, *p++);
|
||||
|
||||
if (wsi->parser_state != WSI_PARSING_COMPLETE) {
|
||||
fprintf(stderr, "libwebsocket_client_handshake "
|
||||
"server response failed parsing\n");
|
||||
goto bail3;
|
||||
}
|
||||
/*
|
||||
* may be coming in multiple packets, there is a 5-second
|
||||
* libwebsocket timeout still active here too, so if parsing did
|
||||
* not complete just wait for next packet coming in this state
|
||||
*/
|
||||
|
||||
if (wsi->parser_state != WSI_PARSING_COMPLETE)
|
||||
break;
|
||||
|
||||
/*
|
||||
* 00 / 76 -->
|
||||
|
|
Loading…
Add table
Reference in a new issue