Mercurial > hg > nginx
comparison src/http/modules/ngx_http_gzip_filter_module.c @ 5045:63a6b6d70826 stable-1.2
Merge of r4966: gzip: fixed zlib memLevel adjusting.
An incorrect memLevel (lower than 1) might be passed to deflateInit2() if the
"gzip_hash" directive is set to a value less than the value of "gzip_window"
directive. This resulted in "deflateInit2() failed: -2" alert and an empty
reply.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 10 Feb 2013 03:52:26 +0000 |
parents | 93dd50a9dc70 |
children | be9ce2946a8e |
comparison
equal
deleted
inserted
replaced
5044:48d1606107d4 | 5045:63a6b6d70826 |
---|---|
495 | 495 |
496 while (r->headers_out.content_length_n < ((1 << (wbits - 1)) - 262)) { | 496 while (r->headers_out.content_length_n < ((1 << (wbits - 1)) - 262)) { |
497 wbits--; | 497 wbits--; |
498 memlevel--; | 498 memlevel--; |
499 } | 499 } |
500 | |
501 if (memlevel < 1) { | |
502 memlevel = 1; | |
503 } | |
500 } | 504 } |
501 | 505 |
502 ctx->wbits = wbits; | 506 ctx->wbits = wbits; |
503 ctx->memlevel = memlevel; | 507 ctx->memlevel = memlevel; |
504 | 508 |