]> granicus.if.org Git - apache/commitdiff
Oops.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Wed, 5 Jun 2002 09:08:02 +0000 (09:08 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Wed, 5 Jun 2002 09:08:02 +0000 (09:08 +0000)
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

index 34f430ee0d50d311fc86fe6c3ccbb865af1ca1f7..9f3d02ec0c8b5255701cabd30aa045092d43505e 100644 (file)
@@ -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;
 }