httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Fri, 11 Jun 2004 19:44:23 GMT
ake         2004/06/11 12:44:23

  Modified:    .        CHANGES
               modules/filters mod_deflate.c
  Log:
  Don't deflate responses with zero length e.g. proxied 304's
  
  Revision  Changes    Path
  1.1512    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1511
  retrieving revision 1.1512
  diff -u -r1.1511 -r1.1512
  --- CHANGES	11 Jun 2004 16:17:58 -0000	1.1511
  +++ CHANGES	11 Jun 2004 19:44:23 -0000	1.1512
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_deflate: Don't deflate responses with zero length 
  +     e.g. proxied 304's [Allan Edwards]
  +
     *) <VirtualHost myhost> now applies to all IP addresses for myhost
        instead of just the first one reported by the resolver.  This
        corrects a regression since 1.3.  [Jeff Trawick]
  
  
  
  1.50      +17 -0     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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- mod_deflate.c	1 Jun 2004 13:06:10 -0000	1.49
  +++ mod_deflate.c	11 Jun 2004 19:44:23 -0000	1.50
  @@ -255,6 +255,8 @@
        * we're in better shape.
        */
       if (!ctx) {
  +        int eos_only = 1;
  +        apr_bucket *bkt;
           char *buf, *token;
           const char *encoding;
   
  @@ -370,6 +372,21 @@
                   return ap_pass_brigade(f->next, bb);
               }
           }
  +
  +        /* don't deflate responses with zero length e.g. proxied 304's */
  +        for (bkt = APR_BRIGADE_FIRST(bb);
  +             bkt != APR_BRIGADE_SENTINEL(bb);
  +             bkt = APR_BUCKET_NEXT(bkt))
  +        {
  +            if (!APR_BUCKET_IS_EOS(bkt)) {
  +                 eos_only = 0;                 
  +                 break;
  +            }
  +        }
  +        if (eos_only) {
  +            return ap_pass_brigade(f->next, bb);
  +        }
  +
           /* We're cool with filtering this. */
           ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
           ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
  
  
  

Mime
View raw message