Jeremy Nixon wrote:
> I'm having some frustration with managing Perl handler registrations.
> 
> It seems that, if I register a handler from within my code, either using
> push_handlers or by grabbing the list with get_handlers, modifying it,
> and then doing set_handlers -- any other handlers for that phase that
> were registered in httpd.conf with Perl*Handler are dropped and never
> called.
> 
> So if, in a PostReadRequestHandler, I do
> 
>  $r->push_handlers('PerlFixupHandler',\&foo);
> 
> Then anything in httpd.conf like
> 
>  PerlFixupHandler Module::foo
> 
> never happens.  The same result occurs if I do get_handlers, add my
> handler to the list, and then put it back with set_handlers.
[...]
> 
> So, what am I missing?  Is there a portion of the docs I somehow overlooked?
> I'm perfectly willing to feel silly for even asking, if I actually find an
> answer to this problem. :)

I just tested this functionality with a few test handlers, and I was
able to replicate your problem.

But... once I changed my return codes to allow the other handlers to
return DECLINED instead of OK in a couple of particular situations,
push_handlers() behaved as I would have expected it to.  I'm guessing
that your PerlFixupHandler is set to return OK instead of DECLINED
somewhere (or maybe not, PerlFixupHandler is RUN_ALL last time I checked).

Take a look at
http://perl.apache.org/docs/2.0/user/handlers/intro.html#Stacked_Handlers

and see if that answers some of your questions.  If you want the tests I
ran to convince yourself, send me an email off list and I'll send them
to you.  If you still can't get the desired behavior, posting a the
configuration and handler code would give us a better idea of the exact
problem.

Reply via email to