From 003afc8b56c67f99e8890ce0619c2f771b26efa6 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Wed, 4 Sep 2019 21:01:30 -0700 Subject: [PATCH] all client autobahn test should pass ! last failing one was ... +- zlib/deflate has a bug with windowsbits == 8, so we silently upgrade it to 9/ (fix autobahn test 13.X which uses 8 for the windows size) --- DOCKER_VERSION | 2 +- docs/CHANGELOG.md | 5 +++++ .../IXWebSocketPerMessageDeflateOptions.cpp | 14 ++++++++++++++ ixwebsocket/IXWebSocketPerMessageDeflateOptions.h | 2 ++ ixwebsocket/IXWebSocketVersion.h | 2 +- 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 91ff5727..09b254e9 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -5.2.0 +6.0.0 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0f0fe8b5..c8b56967 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## [6.0.0] - 2019-09-04 + +- all client autobahn test should pass ! +- zlib/deflate has a bug with windowsbits == 8, so we silently upgrade it to 9/ (fix autobahn test 13.X which uses 8 for the windows size) + ## [5.2.0] - 2019-09-04 - Fragmentation: for sent messages which are compressed, the continuation fragments should not have the rsv1 bit set (fix all autobahn tests for zlib compression 12.X) diff --git a/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp b/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp index db13b947..225d0bbb 100644 --- a/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp +++ b/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp @@ -33,6 +33,8 @@ namespace ix _serverNoContextTakeover = serverNoContextTakeover; _clientMaxWindowBits = clientMaxWindowBits; _serverMaxWindowBits = serverMaxWindowBits; + + sanitizeClientMaxWindowBits(); } // @@ -107,10 +109,22 @@ namespace ix _clientMaxWindowBits = std::min(maxClientMaxWindowBits, std::max(x, minClientMaxWindowBits)); + + sanitizeClientMaxWindowBits(); } } } + void WebSocketPerMessageDeflateOptions::sanitizeClientMaxWindowBits() + { + // zlib/deflate has a bug with windowsbits == 8, so we silently upgrade it to 9 + // See https://bugs.chromium.org/p/chromium/issues/detail?id=691074 + if (_clientMaxWindowBits == 8) + { + _clientMaxWindowBits = 9; + } + } + std::string WebSocketPerMessageDeflateOptions::generateHeader() { std::stringstream ss; diff --git a/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h b/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h index 5cf5ee90..3e960f11 100644 --- a/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h +++ b/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h @@ -41,5 +41,7 @@ namespace ix bool _serverNoContextTakeover; int _clientMaxWindowBits; int _serverMaxWindowBits; + + void sanitizeClientMaxWindowBits(); }; } // namespace ix diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 31fba011..28355fc8 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "5.2.0" +#define IX_WEBSOCKET_VERSION "6.0.0"