]> granicus.if.org Git - apache/commitdiff
Don't attempt to hold all of the response until we're done. We'll pass data on
authorJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 22 Jul 2003 05:36:54 +0000 (05:36 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 22 Jul 2003 05:36:54 +0000 (05:36 +0000)
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

CHANGES
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index e21733c5b12ddead18f66fb64d9cf6e7d1d19d02..d7208388f0b3fcca7e0ecee09bd017da308f8914 100644 (file)
--- 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 <ronald.park@cnet.com>, AndrĂ© Malo, Cliff Woolley]
index 1285da8f58da9bbe8c1bbb7f27558f560dac0f07..2744515aabbd282e7a812a9e35fb5df810294b76 100644 (file)
@@ -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);