serf-dev mailing list archives

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

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

Please see deflate_buckets.c:505:

    case STATE_COMPRESS_INIT:
        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().

]]]


Regards,
Evgeny Kotkov

Mime
View raw message