]> granicus.if.org Git - apache/commitdiff
here applies the same. Don't skip the \0 delimiter when searching
authorAndré Malo <nd@apache.org>
Tue, 19 Aug 2003 14:56:12 +0000 (14:56 +0000)
committerAndré Malo <nd@apache.org>
Tue, 19 Aug 2003 14:56:12 +0000 (14:56 +0000)
for already applied encodings. Additionally don't compress if *any*
non-identity encoding was applied before. (deflate, pkzip, whatever).

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

modules/filters/mod_deflate.c

index d02431c014830e362c1ea6983feefea4bf6e31e8..74d3c039743d66bf712a538f6ea5c1297d4d7e78 100644 (file)
@@ -325,7 +325,8 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
         }
 
         /* Let's see what our current Content-Encoding is.
-         * If gzip is present, don't gzip again.  (We could, but let's not.)
+         * If it's already encoded, don't compress again.
+         * (We could, but let's not.)
          */
         encoding = apr_table_get(r->headers_out, "Content-Encoding");
         if (encoding) {
@@ -350,14 +351,20 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
             const char *tmp = encoding;
 
             token = ap_get_token(r->pool, &tmp, 0);
-            while (token && token[0]) {
-                if (!strcasecmp(token, "gzip")) {
+            while (token && *token) {
+                /* stolen from mod_negotiation: */
+                if (strcmp(token, "identity") && strcmp(token, "7bit") &&
+                    strcmp(token, "8bit") && strcmp(token, "binary")) {
+
                     ap_remove_output_filter(f);
                     return ap_pass_brigade(f->next, bb);                       
                 }
+
                 /* Otherwise, skip token */
-                tmp++;
-                token = ap_get_token(r->pool, &tmp, 0);
+                if (*tmp) {
+                    ++tmp;
+                }
+                token = (*tmp) ? ap_get_token(r->pool, &tmp, 0) : NULL;
             }
         }