(websocket server) fix regression from 8.1.2, where per-deflate message compression was always disabled

This commit is contained in:
Benjamin Sergeant 2020-02-22 10:15:43 -08:00
parent 242c945400
commit 8837d5e784
5 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.
## [8.1.4] - 2020-02-22
(websocket server) fix regression from 8.1.2, where per-deflate message compression was always disabled
## [8.1.3] - 2020-02-21
(client + server) Fix #155 / http header parser should treat the space(s) after the : delimiter as optional. Fixing this bug made us discover that websocket sub-protocols are not properly serialiazed, but start with a ,

View File

@ -134,6 +134,13 @@ namespace ix
_enablePong = false;
}
void WebSocket::enablePerMessageDeflate()
{
std::lock_guard<std::mutex> lock(_configMutex);
WebSocketPerMessageDeflateOptions perMessageDeflateOptions(true);
_perMessageDeflateOptions = perMessageDeflateOptions;
}
void WebSocket::disablePerMessageDeflate()
{
std::lock_guard<std::mutex> lock(_configMutex);

View File

@ -57,6 +57,7 @@ namespace ix
void setPingTimeout(int pingTimeoutSecs);
void enablePong();
void disablePong();
void enablePerMessageDeflate();
void disablePerMessageDeflate();
void addSubProtocol(const std::string& subProtocol);

View File

@ -87,7 +87,11 @@ namespace ix
webSocket->disablePong();
}
if (!_enablePerMessageDeflate)
if (_enablePerMessageDeflate)
{
webSocket->enablePerMessageDeflate();
}
else
{
webSocket->disablePerMessageDeflate();
}

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "8.1.3"
#define IX_WEBSOCKET_VERSION "8.1.4"