From: Yann Ylavic Date: Fri, 28 Feb 2014 09:42:41 +0000 (+0000) Subject: mod_deflate: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=421520221c0e5b68504cbde0bf1f2915a94debbe;p=thirdparty%2Fapache%2Fhttpd.git mod_deflate: Don't fail when asked to flush inflated data to the user-agent and that coincides with the end of stream ("Zlib error flushing inflate buffer"). PR 56196. Submitted By: [Christoph Fausak ] Committed By: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572896 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 1d48ddfc977..b7d0d666c4d 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -1521,7 +1521,11 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, /* flush the remaining data from the zlib buffers */ zRC = flush_libz_buffer(ctx, c, f->c->bucket_alloc, inflate, Z_SYNC_FLUSH, UPDATE_CRC); - if (zRC != Z_OK) { + if (zRC == Z_STREAM_END) { + ctx->validation_buffer = apr_pcalloc(f->r->pool, + VALIDATION_SIZE); + } + else if (zRC != Z_OK) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01402) "Zlib error %d flushing inflate buffer (%s)", zRC, ctx->stream.msg);