]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backporting from 2.1:
authorStas Bekman <stas@apache.org>
Wed, 13 Aug 2003 21:14:13 +0000 (21:14 +0000)
committerStas Bekman <stas@apache.org>
Wed, 13 Aug 2003 21:14:13 +0000 (21:14 +0000)
  *) Fix mod_deflate so that it does not call deflate() without checking
     first whether it has something to deflate. (Currently this causes
     deflate to generate a fatal error according to the zlib spec.)
     PR 22259.
PR:
Obtained from:
Submitted by:
Reviewed by:

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

CHANGES
STATUS
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index f60f944b057ff397e3d2f70dc859124a9d34f13a..1fa4e3df7826acd1c5185400d5b6c0d1a0e97e96 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Changes with Apache 2.0.48
 
+  *) Fix mod_deflate so that it does not call deflate() without checking
+     first whether it has something to deflate. (Currently this causes
+     deflate to generate a fatal error according to the zlib spec.)
+     PR 22259. [Stas Bekman]
+
   *) mod_ssl: Fix FakeBasicAuth for subrequest.  Log an error when an
      identity spoof is encountered.
      [Sander Striker]
diff --git a/STATUS b/STATUS
index b5a5f6dac025fdd09e272540cb2b701ccc7d2881..388575285052fb790bdcb41ef6ec9c3161b45e82 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2003/08/13 21:09:38 $]
+Last modified at [$Date: 2003/08/13 21:14:13 $]
 
 Release:
 
@@ -65,13 +65,6 @@ PATCHES TO PORT FROM 2.1
   [ please place file names and revisions from HEAD here, so it is easy to
     identify exactly what the proposed changes are! ]
 
-    * Fix mod_deflate so that it does not call deflate() without checking
-      first whether it has something to deflate. (Currently this causes
-      deflate to generate a fatal error according to the zlib spec.)
-      PR 22259. [Stas Bekman]
-      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/filters/mod_deflate.c.diff?r1=1.35&r2=1.36
-      +1: stas, jwoolley, nd
-
     * Correct the code in ap_check_cache_feshness to check max_age, smax_age,
       and expires correctly. This is a RFC 2616 compliance issue.
       http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/experimental/cache_util.c.diff?r1=1.26&r2=1.27
index 2744515aabbd282e7a812a9e35fb5df810294b76..3730b5685b089cf72ac859c19e56a9d9f8243e6d 100644 (file)
@@ -530,10 +530,11 @@ 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;
+            if (ctx->stream.avail_in > 0) {
+                zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
+                if (zRC != Z_OK) {
+                    return APR_EGENERAL;
+                }
             }
 
             ctx->stream.next_out = ctx->buffer;