perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <>
Subject Re: [mp2 bug] push_handlers(PostConfig...) on vhost is silently ignored
Date Thu, 24 Nov 2005 02:34:39 GMT
Stas Bekman wrote:
> Configuring PostConfig phase via push_handlers on the vhost server is
> silently ignored under mp2.
> For example a custom directive handler FooBar:
> sub FooBar {
>     my ($self, $parms, $arg) = @_;
>     my $s = $parms->server;
>     # XXX: calling it on the non-vhost server works
>     #Apache2::ServerUtil->server->push_handlers(
>     $s->push_handlers(
>         PerlPostConfigHandler => \&post_config);
>     ...
> See the attached tarball that reproduces the problem.
> I think the solution should be either change modperl_post_config_handler
> to iterate over vhosts or it should explode when a user tries to
> register the callback on a vhost server (but it'll affect the
> push_handlers run-time performance a bit), to handle the special case.

I've been looking over this issue, and I think that iterating over vhosts does
sound tempting, but it would mean different behaviour than it's related httpd

I do not like the fact that a vhost-registered postconfig hook just ends up
not running at all though.

I would avoid the overhead by carefull documentation
"PostConfig and OpenLog *must* be called on the main server !!!"

I've quickly implemented this looping over vhosts, and the problem it causes is
that handlers defined in the main server are being run over and over for each
vhost ;-S

Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

View raw message