From: Nick Kew Date: Sat, 29 Sep 2007 15:43:08 +0000 (+0000) Subject: mod_deflate: initialise inflate-out filter correctly when the X-Git-Tag: 2.3.0~1372 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=475cd14236335b8a97fe2a104b041f93632a15c0;p=apache mod_deflate: initialise inflate-out filter correctly when the first brigade contains no data buckets. PR 43512 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580598 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 0f425bf6b3..ffec347b08 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_deflate: initialise inflate-out filter correctly when the + first brigade contains no data buckets. + PR 43512 [Nick Kew] + *) proxy: Fix persistent backend connections PR 43472 [Ruediger Pluem] diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index f82b75b7c0..07ca194f97 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -293,6 +293,7 @@ typedef struct deflate_ctx_t int (*libz_end_func)(z_streamp); unsigned char *validation_buffer; apr_size_t validation_buffer_length; + int inflate_init; } deflate_ctx; /* Number of validation bytes (CRC and length) after the compressed data */ @@ -983,7 +984,6 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, { int zlib_method; int zlib_flags; - int inflate_init = 1; apr_bucket *e; request_rec *r = f->r; deflate_ctx *ctx = f->ctx; @@ -1067,7 +1067,7 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, ctx->stream.next_out = ctx->buffer; ctx->stream.avail_out = c->bufferSize; - inflate_init = 0; + ctx->inflate_init = 0; } while (!APR_BRIGADE_EMPTY(bb)) @@ -1172,7 +1172,7 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, apr_bucket_read(e, &data, &len, APR_BLOCK_READ); /* first bucket contains zlib header */ - if (!inflate_init++) { + if (!ctx->inflate_init++) { if (len < 10) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Insufficient data for inflate");