From 5abf4a78bdb680a949711e28af8986d4014af9ad Mon Sep 17 00:00:00 2001 From: David Baird Date: Wed, 12 Nov 2014 00:53:51 -0500 Subject: [PATCH] Fix large frame >=65536 bytes header_size bug #37. Was being calculated as 8 (wrong). Now corrected to 10. --- easywsclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easywsclient.cpp b/easywsclient.cpp index f7068ac..bcc152d 100644 --- a/easywsclient.cpp +++ b/easywsclient.cpp @@ -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) {