diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e9718265..2884d627 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [8.3.4] - 2020-03-23 + +(websocket) fix #167, a long standing issue with sending empty messages with per-message deflate extension (and hopefully other zlib bug) + ## [8.3.3] - 2020-03-22 (cobra to statsd) port to windows and add a unittest diff --git a/ixwebsocket/IXUdpSocket.cpp b/ixwebsocket/IXUdpSocket.cpp index 46eaaf92..e15e083a 100644 --- a/ixwebsocket/IXUdpSocket.cpp +++ b/ixwebsocket/IXUdpSocket.cpp @@ -7,8 +7,8 @@ #include "IXUdpSocket.h" #include "IXNetSystem.h" -#include #include +#include namespace ix { diff --git a/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp b/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp index 72bc41ab..dc307c7f 100644 --- a/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp +++ b/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp @@ -89,8 +89,12 @@ namespace ix if (in.empty()) { - uint8_t buf[6] = {0x02, 0x00, 0x00, 0x00, 0xff, 0xff}; - out.append((char*) (buf), 6); + // See issue #167 + // The normal buffer size should be 6 but + // we remove the 4 octets from the tail (#4) + uint8_t buf[2] = {0x02, 0x00}; + out.append((char*) (buf), 2); + return true; } diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 81f9981e..9a004a53 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "8.3.3" +#define IX_WEBSOCKET_VERSION "8.3.4"