/[Apache-SVN]/httpd/httpd/trunk/modules/filters/mod_deflate.c
ViewVC logotype

Diff of /httpd/httpd/trunk/modules/filters/mod_deflate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- httpd/httpd/trunk/modules/filters/mod_deflate.c	2007/08/06 19:24:10	563230
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c	2007/08/06 22:45:39	563317
@@ -88,10 +88,18 @@
  * If a request has multiple encodings, we need the gzip
  * to be the outermost non-identity encoding.
  */
-static int check_gzip(apr_pool_t *pool, apr_table_t *hdrs)
+static int check_gzip(apr_pool_t *pool, apr_table_t *hdrs,
+                      apr_table_t *hdrs2, const char *enc_in)
 {
     int found = 0;
     const char *encoding = apr_table_get(hdrs, "Content-Encoding");
+
+    if (!encoding && (hdrs2 != NULL)) {
+        encoding = apr_table_get(hdrs2, "Content-Encoding");
+    }
+    if (!encoding) {
+        encoding = enc_in;
+    }
     if (encoding && *encoding) {
 
         /* check the usual/simple case first */
@@ -735,7 +743,7 @@
          *
          * If not, we just remove ourself.
          */
-        if (check_gzip(r->pool, r->headers_in) == 0) {
+        if (check_gzip(r->pool, r->headers_in, NULL, NULL) == 0) {
             ap_remove_input_filter(f);
             return ap_get_brigade(f->next, bb, mode, block, readbytes);
         }
@@ -990,7 +998,8 @@
          * Let's see what our current Content-Encoding is.
          * Only inflate if gzipped.
          */
-        if (check_gzip(r->pool, r->headers_out) == 0) {
+        if (check_gzip(r->pool, r->headers_out, r->err_headers_out,
+                       r->content_encoding) == 0) {
             ap_remove_output_filter(f);
             return ap_pass_brigade(f->next, bb);
         }

 

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2