From: Justin Erenkrantz Date: Tue, 22 Jul 2003 05:36:54 +0000 (+0000) Subject: Don't attempt to hold all of the response until we're done. We'll pass data on X-Git-Tag: pre_ajp_proxy~1389 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=774c4e5cacd55c39e3152c1f31ff587aaceb4902;p=apache Don't attempt to hold all of the response until we're done. We'll pass data on when the zlib buffer becomes full and we need to reset the buffer anyway. Also, tidy up a similar semantic when we see the EOS by returning an error if ap_pass_brigade gets an error (we'd lose it otherwise). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100730 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e21733c5b1..d7208388f0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_deflate: Don't attempt to hold all of the response until we're + done. [Justin Erenkrantz] + *) mod_include: Fix a trio of bugs that would cause various unusual sequences of parsed bytes to omit portions of the output stream. PR 21095. [Ron Park , André Malo, Cliff Woolley] diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 1285da8f58..2744515aab 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -529,6 +529,8 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, if (APR_BUCKET_IS_FLUSH(e)) { apr_bucket *bkt; + apr_status_t rv; + zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH); if (zRC != Z_OK) { return APR_EGENERAL; @@ -544,7 +546,10 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, bkt = apr_bucket_flush_create(f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->bb, bkt); - ap_pass_brigade(f->next, ctx->bb); + rv = ap_pass_brigade(f->next, ctx->bb); + if (rv != APR_SUCCESS) { + return rv; + } continue; } @@ -562,6 +567,8 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, while (ctx->stream.avail_in != 0) { if (ctx->stream.avail_out == 0) { + apr_status_t rv; + ctx->stream.next_out = ctx->buffer; len = c->bufferSize - ctx->stream.avail_out; @@ -569,6 +576,11 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, NULL, f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->bb, b); ctx->stream.avail_out = c->bufferSize; + /* Send what we have right now to the next filter. */ + rv = ap_pass_brigade(f->next, ctx->bb); + if (rv != APR_SUCCESS) { + return rv; + } } zRC = deflate(&(ctx->stream), Z_NO_FLUSH);