httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: AddOutputFilter hook needed?
Date Tue, 19 Sep 2000 09:46:35 GMT

> Let's ignore for a moment the particular hook where the module's ap_add_filter()
> call is coded. 
> Let's say that a module implements logic to decide to insert a filter
> during some other hook.  When the module is configured to perform a
> certain operation, its filter must be inserted.  If there is an
> AddOutputFilter statement, the module is happy to stay out of mucking
> with the filter chain.  If there is no AddOutputFilter statement, the
> module wants to call ap_add_filter() to insert the filter.  Otherwise,
> the module can't possibly perform the requested operation.
> How does the module know that there is an AddOutputFilter directive
> and that the module should not add its filter implicitly?
> If the module doesn't need to know, how do we keep the filter from
> being added more than once?  (AddOutputFilter processing could
> supercede any ap_add_filter() calls from modules.) 

My current thinking is to punt this issue to the module itself.  I am
thinking that filters that shouldn't be added twice will just keep track
of if they have ever been called for this request, and remove themselves
from the stack if they have already been called once.  This actually
wouldn't be that hard to implement, and it leaves a lot of flexibility to
the modules to determine how many times they should be called for a
request.  This also has another advantageous feature.  It delays the
decision until we are running the filter stack.  This means that there is
no opportunity for a filter to be added after the check, because the call
to the filter IS the check.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message