From 5b67c6275a5cc40fcdb7116a5f3cad8a18d431de Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 5 Jun 2002 09:08:02 +0000 Subject: [PATCH] Oops. When deflating: only reset ctx->stream buffers when the ctx was NULL. When inflating: remember to clear the ctx->bb after we're done with it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95521 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_deflate.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 34f430ee0d..9f3d02ec0c 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -365,12 +365,12 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, } apr_table_setn(r->headers_out, "Vary", "Accept-Encoding"); apr_table_unset(r->headers_out, "Content-Length"); + + /* initialize deflate output buffer */ + ctx->stream.next_out = ctx->buffer; + ctx->stream.avail_out = c->bufferSize; } - /* initialize deflate output buffer */ - ctx->stream.next_out = ctx->buffer; - ctx->stream.avail_out = c->bufferSize; - APR_BRIGADE_FOREACH(e, bb) { const char *data; apr_bucket *b; @@ -713,13 +713,13 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, } inflateEnd(&ctx->stream); - apr_brigade_cleanup(ctx->bb); eos = apr_bucket_eos_create(f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, eos); break; } } + apr_brigade_cleanup(ctx->bb); } if (!APR_BRIGADE_EMPTY(ctx->proc_bb)) { @@ -733,8 +733,6 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, APR_BRIGADE_CONCAT(ctx->proc_bb, newbb); } - - return APR_SUCCESS; } -- 2.40.0