Andrew Wyllie wrote:
<Location /TestError::push_handlers>
SetHandler modperl PerlResponseHandler TestError::push_handlers
</Location>
Does it appear when you run t/TEST -conf?
Nope:nick@fatboy /tmp/build/modperl-2.0>t/TEST -conf *** cleaning out current configuration *** reconfiguration done nick@fatboy /tmp/build/modperl-2.0>ll /home/tmp/build/modperl-2.0/t/htdocs/TestError::push_handlers ls: /home/tmp/build/modperl-2.0/t/htdocs/TestError::push_handlers: No such file or directoryI'm also seeing this test fail. The Location is in the httpd.conf file, but it's not picking it up for some reason.
I take it back, I uncommented the warn statements in TestError/push_handlers.pm and the first one "handler called"
is printed into the log. If I change the line:
$r->push_handlers(PerlResponseHandler => \&real_response);
to $r->push_handlers(PerlResponseHandler => \&real_response($r));
Heh, you need to pass a callback, not execute it.
the method real_response gets called (prints real_response calledAs the name of the test indicates it tests something that you shouldn't be doing. You can read the explanation at the top of
in log file), but, the test still does not pass.
But, when I take out return Apache::DECLINED; and replace
with return Apache::OK; the test passes.
So, when you push a handler, is the cycle supposed to continue if one of the pushed handlers returns OK or is it supposed to
stop as soon as it hits an OK? I would have thought that when the method being pushed returned Apache::OK, that I would
never arrive at the Apache::DECLINED in the original handler.
t/response/TestError/push_handlers.pm
The trick is that the first handler runs under 'modperl', the newly pushed handler is run under 'perl-script' and on my setup, Apache runs the 'perl-script' handlers after it's finished trying 'modperl' handlers (if they all have returned DECLINED).
I've added this test after a report to the list where the user have misused push_handlers.
So if fails for you because it falls through to the default handler and doesn't call the pushed handler. Dunno why is it different on FreeBSD, but I'll disable it for now.
__________________________________________________________________
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
