From: Stas Bekman Date: Wed, 13 Aug 2003 21:14:13 +0000 (+0000) Subject: backporting from 2.1: X-Git-Tag: 2.0.48~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a5d4c79cbfa0e102e83a86fade06468b5878d2;p=thirdparty%2Fapache%2Fhttpd.git backporting from 2.1: *) 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 --- diff --git a/CHANGES b/CHANGES index f60f944b057..1fa4e3df782 100644 --- 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 b5a5f6dac02..38857528505 100644 --- 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 diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 2744515aabb..3730b5685b0 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -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;