You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2002/05/07 01:37:16 UTC

cvs commit: httpd-2.0/modules/filters mod_deflate.c

jerenkrantz    02/05/06 16:37:16

  Modified:    modules/filters mod_deflate.c
  Log:
  If we determine that we shouldn't be involved in this request, remove
  ourselves from the filter chain (so we don't duplicate this path
  each time a brigade comes through).
  
  Revision  Changes    Path
  1.2       +5 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_deflate.c	6 May 2002 22:23:52 -0000	1.1
  +++ mod_deflate.c	6 May 2002 23:37:15 -0000	1.2
  @@ -234,6 +234,7 @@
   
           /* only work on main request/no subrequests */
           if (r->main) {
  +            ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }
   
  @@ -241,6 +242,7 @@
            * (with browsermatch) for them
            */
           if (apr_table_get(r->subprocess_env, "no-gzip")) {
  +            ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }
   
  @@ -251,12 +253,14 @@
           if ((r->content_type == NULL
                || strncmp(r->content_type, "text/html", 9))
               && apr_table_get(r->subprocess_env, "gzip-only-text/html")) {
  +            ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }
   
           /* if they don't have the line, then they can't play */
           accepts = apr_table_get(r->headers_in, "Accept-Encoding");
           if (accepts == NULL) {
  +            ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }
   
  @@ -269,6 +273,7 @@
   
           /* No acceptable token found. */
           if (token == NULL || token[0] == '\0') {
  +            ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }