serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Kotkov <>
Subject [PATCH] Fix default compression level in deflate compress buckets
Date Wed, 24 Aug 2016 20:29:00 GMT

I noticed that deflate compress buckets use an inappropriate value as
the compression level for `deflateInit2()`.

Please see deflate_buckets.c:505:

        zRC = deflateInit2(&ctx->zstream, Z_DEFAULT_STRATEGY, Z_DEFLATED,
                           ctx->windowSize, ctx->memLevel, Z_DEFAULT_STRATEGY);

The code above passes Z_DEFAULT_STRATEGY (0) as the compression
level, and this entirely disables the compression.  I tend to think that
the intention here was to use Z_DEFAULT_COMPRESSION (-1).  Note that
the compress buckets are only available in trunk, and that they currently
aren't used anywhere except the tests.

Please see the attached patch.

Log message:
Fix default compression level in deflate compress buckets.

* buckets/deflate_buckets.c
  (serf_deflate_wait_for_data): Pass Z_DEFAULT_COMPRESSION instead
   of Z_DEFAULT_STRATEGY as the compression level to deflateInit2().


Evgeny Kotkov

View raw message