Fix large frame >=65536 bytes header_size bug #37. Was being calculated as 8 (wrong). Now corrected to 10.

This commit is contained in:
David Baird
2014-11-12 00:53:51 -05:00
parent bf059090de
commit 5abf4a78bd
+1 -1
View File
@@ -252,7 +252,7 @@ class _RealWebSocket : public easywsclient::WebSocket
ws.opcode = (wsheader_type::opcode_type) (data[0] & 0x0f);
ws.mask = (data[1] & 0x80) == 0x80;
ws.N0 = (data[1] & 0x7f);
ws.header_size = 2 + (ws.N0 == 126? 2 : 0) + (ws.N0 == 127? 6 : 0) + (ws.mask? 4 : 0);
ws.header_size = 2 + (ws.N0 == 126? 2 : 0) + (ws.N0 == 127? 8 : 0) + (ws.mask? 4 : 0);
if (rxbuf.size() < ws.header_size) { return; /* Need: ws.header_size - rxbuf.size() */ }
int i;
if (ws.N0 < 126) {