Skip to content

Commit

Permalink
zlib: use Z_DEFAULT_STRATEGY by default instead of Z_FIXED
Browse files Browse the repository at this point in the history
Since Envoy::Compressor::ZlibCompressorImpl::CompressionStrategy is
simply static_cast'ed to uint64_t the Standard strategy (4)
becomes Z_FIXED (4 as well). This basically disables the use of
dynamic Huffman codes when the gzip filter is configured to use
default values.

Make the Standard strategy equal to 0 to translate to
Z_DEFAULT_STRATEGY.

Contributes to envoyproxy#8448

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
  • Loading branch information
Dmitry Rozhkov committed Apr 7, 2020
1 parent 9970602 commit 03aa107
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/common/compressor/zlib_compressor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ZlibCompressorImpl : public Zlib::Base, public Compressor {
Filtered = 1,
Huffman = 2,
Rle = 3,
Standard = 4,
Standard = 0,
};

/**
Expand Down

0 comments on commit 03aa107

Please sign in to comment.