httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: [PATCH] merging AddOutputFilter directives
Date Tue, 26 Sep 2000 22:49:51 GMT

I kind of disagree with this.  I would much prefer to see a remove filter
directive analogous to the RemoveHandler directive.  I think this is more
in line with what we do for handlers, so it makes a bit more sense in my
mind.

Just an opinion though.

Ryan

On Tue, 26 Sep 2000, Jeff Trawick wrote:

> Currently, the merge operation for AddOutputFilter directives appends
> the filter list in the new directory to the filter list in the base
> directory.
> 
> If you have
> 
> <Directory />
> AddOutputFilter A
> </Directory>
> 
> <Directory /somedir>
> AddOutputFilter B
> </Directory>
> 
> <Directory /somedir/someotherdir>
> AddOutputFilter C
> </Directory>
> 
> then the filter chain for /somedir will be A B and the filter chain
> for /somedir/someotherdir will be A B C.  That may be fine in some
> cases, but what if you don't want filter A in /somedir/someotherdir or
> you want it in a different order?  Even if that were always what any
> sane person wanted, less error prone to look at the config file and
> look at the configured filter list.
> 
> The following patch requires that the full list of filters be
> specified on each AddOutputFilter; no such appending is done.  Thus,
> a different order or different set of filters can be specified.  (The
> patch doesn't take care of the fact that you can't get rid of the darn
> filter list.  Perhaps we need to allow something like "AddOutputFilter
> None" or "NoOutputFilter" or something else to do the job?)
> 
> Index: main/http_core.c
> ===================================================================
> RCS file: /home/cvspublic/apache-2.0/src/main/http_core.c,v
> retrieving revision 1.134
> diff -u -r1.134 http_core.c
> --- main/http_core.c	2000/09/25 16:42:49	1.134
> +++ main/http_core.c	2000/09/26 20:34:50
> @@ -326,7 +326,13 @@
>  	    conf->add_default_charset_name = new->add_default_charset_name;
>  	}
>      }
> -    conf->filters = apr_append_arrays(a, base->filters, new->filters);
> +
> +    if (new->filters->nelts) {
> +        conf->filters = new->filters;
> +    }
> +    else {
> +        conf->filters = base->filters;
> +    }
>  
>      return (void*)conf;
>  }
> 
> -- 
> Jeff Trawick | trawick@ibm.net | PGP public key at web site:
>      http://www.geocities.com/SiliconValley/Park/9289/
>           Born in Roswell... married an alien...
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message