httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r109500 - /httpd/httpd/trunk/modules/filters/mod_deflate.c
Date Thu, 02 Dec 2004 13:45:33 GMT
Author: jorton
Date: Thu Dec  2 05:45:32 2004
New Revision: 109500

URL: http://svn.apache.org/viewcvs?view=rev&rev=109500
Log:
* modules/filters/mod_deflate.c (deflate_out_filter): Check explicitly
for a 304 or 204 response rather than a brigade which begins with EOS,
to correctly handle such responses when generated by a CGI script.
Don't alter the headers for this case either.

Modified:
   httpd/httpd/trunk/modules/filters/mod_deflate.c

Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/filters/mod_deflate.c?view=diff&rev=109500&p1=httpd/httpd/trunk/modules/filters/mod_deflate.c&r1=109499&p2=httpd/httpd/trunk/modules/filters/mod_deflate.c&r2=109500
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c	(original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c	Thu Dec  2 05:45:32 2004
@@ -350,19 +350,9 @@
             }
         }
 
-        /* Deflating a zero-length response would make it longer; the
-         * proxy may pass through an empty response for a 304 too.
-         * So we just need to fix up the headers as if we had a body.
-         */
-        if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) {
-            if (!encoding || !strcasecmp(encoding, "identity")) {
-                apr_table_set(r->headers_out, "Content-Encoding", "gzip");
-            }
-            else {
-                apr_table_merge(r->headers_out, "Content-Encoding", "gzip");
-            }
-            apr_table_unset(r->headers_out, "Content-Length");
-
+        /* For a 304 or 204 response there is no entity included in
+         * the response and hence nothing to deflate. */
+        if (r->status == HTTP_NOT_MODIFIED || r->status == HTTP_NO_CONTENT) {
             ap_remove_output_filter(f);
             return ap_pass_brigade(f->next, bb);
         }

Mime
View raw message