httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jus...@erenkrantz.com>
Subject Re: ap_invoke_filter_init is not called for non-request filters
Date Tue, 08 Apr 2003 15:25:15 GMT
--On Tuesday, April 8, 2003 5:16 PM +1000 Stas Bekman <stas@stason.org> wrote:

> Not really, IMHO. You could always invoke filter_init immediately after
> filters are pushed onto the filter chain. this will work perfectly in the
> pre_connection() phase as suggested by wrowe. I see no indication that the
> filter_init is HTTP protocol specific in the filter API. This at least
> should be documented, so filter authors won't be surprised when they
> register a filter_init function, used with non-HTTP protocol and it won't be
> called.

No, that's incorrect.  Filters may be added and then later removed. 
Therefore, we only want to call the filter_init hook when they are actually in 
use and at the last possible moment.  pre_connection does not work because we 
do not know which filters will be needed until after the request has been 
pre-processed (think of mod_mime's AddOutputFilter directives).  We do this 
after the ap_run_insert_filter hook which is the last possible chance to add a 
filter before content is delivered.

It is the responsibility of the protocol to initialize the filters.  If your 
protocol doesn't invoke handlers *and* it doesn't take the steps to initialize 
the filters itself, then it doesn't follow the httpd model and I don't think 
that's worthy of our time.  -- justin

Mime
View raw message