Add memory limited dedicated compressors

This commit is contained in:
Alex Hultman
2020-02-29 04:06:27 +01:00
parent 7313e0168d
commit 3a856b610b
4 changed files with 70 additions and 22 deletions
+3 -3
View File
@@ -45,12 +45,12 @@ private:
/* We could be a subscriber */
Subscriber *subscriber = nullptr;
public:
WebSocketData(bool perMessageDeflate, bool slidingCompression, std::string &&backpressure) : AsyncSocketData<false>(std::move(backpressure)), WebSocketState<true>() {
WebSocketData(bool perMessageDeflate, int compressOptions, std::string &&backpressure) : AsyncSocketData<false>(std::move(backpressure)), WebSocketState<true>() {
compressionStatus = perMessageDeflate ? ENABLED : DISABLED;
/* Initialize the dedicated sliding window */
if (perMessageDeflate && slidingCompression) {
deflationStream = new DeflationStream;
if (perMessageDeflate && (compressOptions & CompressOptions::DEDICATED_COMPRESSOR)) {
deflationStream = new DeflationStream(compressOptions);
}
}