On Wed, 19 Jan 2000, John Hughes wrote:
> > what happens if you preload Apache::Registry in httpd.conf:
> >
> > PerlModule Apache::Registry
>
> Didn't try that. But code examination seems to imply that it would have
> no effect.
>
> 1. Apache::Registry gets run, so:
>
> unless (defined $Apache::Registry::NameWithVirtualHost) {
> $Apache::Registry::NameWithVirtualHost = 1;
> }
>
> Now NameWithVirtualHost is 1.
>
> 2. a non-virtualhost request is received so perl_handler in mod_perl.c does:
>
> if((nwvh = ApachePerlRun_name_with_virtualhost())) {
> if(!r->server->is_virtual) {
> SAVESPTR(nwvh);
> sv_setiv(nwvh, 0);
> }
> }
>
> now NameWithVirtualHost is 0.
>
> and it stays zero forever.
>
> On reflection my fix is over the top - it has the effect of overriding
> the value of NameWithVirtualHost set by the user.
>
> I don't think perl_handler should be changing NameWithVirtualHost *AT ALL*,
> that should be left up to the user, with a default in Registry.pm.
it used to be that way, but moved to perl_handler because it's a quicker
check in C, and multiple modules (besides Apache::Registry) need this
logic.
> I attach patches to do that. They work for me.
thanks. I'll revisit this soon.
> One last query, what about ApachePerlRun_namespace in PerlRunXS.xs, that
> seems to think that the mere existence of the variable NameWithVirtualHost
> implies that names should be modified with the virtualhost. It doesn't
> check the *VALUE* of the variable:
that's okay, I don't think anybody is using PerlRunXS, I'd be surprised if
it still works at all. if there's to be a xs/c version ala PerlRunXS,
it's put off until modperl-2.0