]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix mod_deflate corruption when using multiple input buckets. We should
authorJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 13 May 2002 07:11:01 +0000 (07:11 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 13 May 2002 07:11:01 +0000 (07:11 +0000)
only clear *_out when we are the beginning or avail_out == 0.

Justin was tracking this down before he went to WWDC and didn't finish
before he left.  A (virtual) beer goes to Asada who filed this PR with
the right patch!

PR: 9014
Submitted by: kaz@asada.sytes.net (ASADA Kazuhisa)
Reviewed by: Justin Erenkrantz

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95055 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index 30ed3771ed2d9417b68c1776ff87a86087928059..be866a5dc7e0761d19b7dd6d9aa25416da278aae 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.37
 
+  *) Fix mod_deflate corruption when using multiple buckets.  PR 9014.
+     [Asada Kazuhisa <kaz@asada.sytes.net>]
+
   *) Performance enhancements for access logger when using
      default timestamp formatting  [Brian Pane]
 
index 658ce925aa488a7b60f29b48a597aed57f9d5bc2..343f05971a60a9d5e214cfcf74a7036fad2354f1 100644 (file)
@@ -326,6 +326,10 @@ 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;
 
     APR_BRIGADE_FOREACH(e, bb) {
         const char *data;
@@ -436,8 +440,6 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
                                                       * but we'll just have to
                                                       * trust zlib */
         ctx->stream.avail_in = len;
-        ctx->stream.next_out = ctx->buffer;
-        ctx->stream.avail_out = c->bufferSize;
 
         while (ctx->stream.avail_in != 0) {
             if (ctx->stream.avail_out == 0) {