Mercurial > hg > nginx
comparison src/http/modules/ngx_http_gzip_filter_module.c @ 4965:58dfef910ccd
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 | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Fri, 14 Dec 2012 15:17:58 +0000 |
parents | 4a18bf1833a9 |
children | e2794322ec76 |
comparison
equal
deleted
inserted
replaced
4964:2464ccebdb52 | 4965:58dfef910ccd |
---|---|
496 | 496 |
497 while (r->headers_out.content_length_n < ((1 << (wbits - 1)) - 262)) { | 497 while (r->headers_out.content_length_n < ((1 << (wbits - 1)) - 262)) { |
498 wbits--; | 498 wbits--; |
499 memlevel--; | 499 memlevel--; |
500 } | 500 } |
501 | |
502 if (memlevel < 1) { | |
503 memlevel = 1; | |
504 } | |
501 } | 505 } |
502 | 506 |
503 ctx->wbits = wbits; | 507 ctx->wbits = wbits; |
504 ctx->memlevel = memlevel; | 508 ctx->memlevel = memlevel; |
505 | 509 |