httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Tue, 19 Aug 2003 12:26:38 GMT
nd          2003/08/19 05:26:38

  Modified:    .        CHANGES
               modules/filters mod_deflate.c
  Log:
  Doh. If Accept-Encoding contains no gzip token, we skip the 0 delimiter
  and search for "gzip" somehwere in the memory. This was originally discovered
  by Joe Orton. But there's more. We must skip any parameters, since these
  do not contain what we're looking for.
  
  PR: 21523
  
  Revision  Changes    Path
  1.1257    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1256
  retrieving revision 1.1257
  diff -u -r1.1256 -r1.1257
  --- CHANGES	19 Aug 2003 00:52:43 -0000	1.1256
  +++ CHANGES	19 Aug 2003 12:26:37 -0000	1.1257
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Fix a bug, where mod_deflate sometimes unconditionally compressed the
  +     content if the Accept-Encoding header contained only other tokens than
  +     "gzip" (such as "deflate"). PR 21523.  [Joe Orton, André Malo]
  +
     *) mod_rewrite: Catch an edge case, where strange subsequent RewriteRules
        could lead to a 400 (Bad Request) response.  [André Malo]
   
  
  
  
  1.37      +11 -3     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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- mod_deflate.c	12 Aug 2003 17:46:29 -0000	1.36
  +++ mod_deflate.c	19 Aug 2003 12:26:38 -0000	1.37
  @@ -376,9 +376,17 @@
   
           token = ap_get_token(r->pool, &accepts, 0);
           while (token && token[0] && strcasecmp(token, "gzip")) {
  -            /* skip token */
  -            accepts++;
  -            token = ap_get_token(r->pool, &accepts, 0);
  +            /* skip parameters, XXX: ;q=foo evaluation? */
  +            while (*accepts == ';') { 
  +                ++accepts;
  +                token = ap_get_token(r->pool, &accepts, 1);
  +            }
  +
  +            /* retrieve next token */
  +            if (*accepts == ',') {
  +                ++accepts;
  +            }
  +            token = (*accepts) ? ap_get_token(r->pool, &accepts, 0) : NULL;
           }
   
           /* No acceptable token found. */
  
  
  

Mime
View raw message