From 243abaf5243f0dedbbfd40c34f86b90960548758 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Wed, 23 Oct 2013 20:45:20 +0300 Subject: [PATCH] Improve comment in gCompress(). --- src/webui/httpresponsegenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webui/httpresponsegenerator.cpp b/src/webui/httpresponsegenerator.cpp index 2968a3dac..70a80b6d6 100644 --- a/src/webui/httpresponsegenerator.cpp +++ b/src/webui/httpresponsegenerator.cpp @@ -80,8 +80,10 @@ bool HttpResponseGenerator::gCompress(QByteArray &dest_buffer) { strm.next_out = reinterpret_cast(tmp_buf); strm.avail_out = BUFSIZE; - //windowBits = 15|32 to enable gzip - ret = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, 15|16, 8, Z_DEFAULT_STRATEGY); + //windowBits = 15+16 to enable gzip + //From the zlib manual: windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits + //to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. + ret = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, 15+16, 8, Z_DEFAULT_STRATEGY); if (ret != Z_OK) return false;