Geoffrey Young wrote:
[...]
no, you need the real filter_init hook.

the issue here is that default_handler has meets_condiditions() logic in it, so it makes decisions about whether or not to send content down the chain. this is generally bad for filters, since they may have their own criteria for determining what gets involved in making that decision - if default-handler doesn't have all the information, it can return NOT_MODIFIED when the filter would have chosen to re-modify the content (based on, say, the fact that the version of the code has changed so it does things differently now).

filter_init is a hook that runs code before any handlers run, I suspect for adding calls to update_mtime() and other similar things.
ok

I agree that having a dedicated filter_init seems to be cleaner and probably more efficient.

If filter_init is wanted, how should it be set by the Perl code? Using an optional second argument to the filter configuration?

PerlOutputFilterHandler MyFilter MyFilter::init

I would want at least a real-time interface for this, something similar to

$filter->init(sub {shift->update_mtime($package_mtime)} );
where would you run this code?

sub handler {
...
}

it's important that the filter be able to insert this logic itself without relying on httpd.conf stuff. that makes the filter self-contained and a bit more DWIMmy. of course, the subroutine/coderef would have to run on each request, similar to $r->register_cleanup, just at the other end.

Obviously for each conf option there should be a perl interface (add/remove filters pending)

Also can you please give me some useful test I can play with? Probably one of the examples from your book will do ;)

I'm working on something now, but without a tie into filter_init there's not much to show :)

if you come up with the interface, I'll write the tests to make sure it does what we need.
Cool.

Is there some C module that uses that hook so I can look at it? I guess somewhere in PHP, because I don't seem to see any in the core modules.

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

Reply via email to