httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: ap_invoke_filter_init is not called for non-request filters
Date Tue, 08 Apr 2003 07:16:52 GMT
Justin Erenkrantz wrote:
> --On Tuesday, April 8, 2003 9:39 AM +1000 Stas Bekman <stas@stason.org> 
> wrote:
> 
>> The punch line is that filters aren't only request oriented.
> 
> 
> Sure, they may be connection-oriented, but, as I said before, they'd 
> still be in the r->input_filters and r->output_filters list.
> 
>> What I'm saying is that currently only filters that process HTTP protocol
>> get a chance to run filter_init. If a non-HTTP protocol is run (there 
>> is no
>> 'r'), the filter_init function will be ignored. Am I more clear now?
> 
> 
> No.  But, if you are using a custom protocol that avoids handlers, then 
> you need to determine the best time to call the filter_init functions.  
> That's a protocol-specific idiom.  HTTP happens to do it before any 
> content is delivered by placing it in the ap_invoke_handler() function.  
> If your protocol doesn't use ap_invoke_handler(), then it has to do that 
> itself.

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.

It's even more add that if you use the same (e.g. connection) filter for HTTP 
and non-HTTP protocol on the same filter, the init function will be called for 
the former but not for the latter.

> Again, if you have a concrete example of what you are trying to 
> accomplish, that would help tremendously.  -- justin

I don't have any immediate example/need. However I find that the current 
design is incomplete. Or if it's complete, it should be documented. I was just 
trying to point that out.

wrowe suggested that we log this issue to STATUS, so the next time someone 
works on related issue, this functionality will be taken into account.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message