From f96bc81bc4948b56e00c1a826f9f094f8c1f5ec7 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 27 Apr 2014 22:39:32 +0000 Subject: [PATCH] mod_deflate: follow up to r1587639. Don't break the looped brigade when moving the FLUSH bucket to the returned bb and continue reading. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1590509 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_deflate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 3944c0d3ca..92d39ff1af 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -1198,7 +1198,7 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, } if (APR_BUCKET_IS_FLUSH(bkt)) { - apr_bucket *tmp_heap; + apr_bucket *tmp_b; zRC = inflate(&(ctx->stream), Z_SYNC_FLUSH); if (zRC != Z_OK) { inflateEnd(&ctx->stream); @@ -1212,16 +1212,18 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, len = c->bufferSize - ctx->stream.avail_out; ctx->crc = crc32(ctx->crc, (const Bytef *)ctx->buffer, len); - tmp_heap = apr_bucket_heap_create((char *)ctx->buffer, len, - NULL, f->c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, tmp_heap); + tmp_b = apr_bucket_heap_create((char *)ctx->buffer, len, + NULL, f->c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, tmp_b); ctx->stream.avail_out = c->bufferSize; /* Flush everything so far in the returning brigade, but continue * reading should EOS/more follow (don't lose them). */ + tmp_b = APR_BUCKET_PREV(bkt); APR_BUCKET_REMOVE(bkt); APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, bkt); + bkt = tmp_b; continue; } -- 2.40.0