nd 2003/08/19 07:56:12
Modified: modules/filters mod_deflate.c
Log:
here applies the same. Don't skip the \0 delimiter when searching
for already applied encodings. Additionally don't compress if *any*
non-identity encoding was applied before. (deflate, pkzip, whatever).
Revision Changes Path
1.38 +12 -5 httpd-2.0/modules/filters/mod_deflate.c
Index: mod_deflate.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- mod_deflate.c 19 Aug 2003 12:26:38 -0000 1.37
+++ mod_deflate.c 19 Aug 2003 14:56:12 -0000 1.38
@@ -325,7 +325,8 @@
}
/* 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 @@
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;
}
}
|