Re: Custom directive and <Location> - bug?

"Philippe M. Chiasson" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On 10-11-30 07:51 , "Alex J. G. Burzyński" wrote:
> Hi,
> 
> I've noticed that when using custom directives within nested <Location>
> the result of $r->location reports the parent one only, instead of the
> subdir.
> 
> However if I add PerlSetVar the $r->location will report the correct one.

Yup, you've stumbled on an interesting bug.

> The way to replicate:
> please follow the example
> http://perl.apache.org/docs/2.0/user/config/custom.html#Merging_at_Work
> 
> and now add:
> 
> --- httpd.conf-orig    2010-11-30 12:06:57.491843181 +0000
> +++ httpd.conf    2010-11-30 12:07:39.217629859 +0000
> @@ -18,6 +18,7 @@
>          PerlResponseHandler MyApache2::CustomDirectivesTest
>      </Location>
>      <Location /custom_directives_test/subdir>
> +        PerlSetVar fix "problem"
>          MyPlus 1
>          MyList     "SubDir"
>          MyAppend   "SubDir"

The reason this makes a difference is that without it, there are no
mod_perl directives (the custom ones are 'special'), so no configuration
pass for modperl in that directory.

Side-effect of that is that $r->location isn't tracked proprely.
Keep in mind that r->location is not an httpd api, but rather something
convenient mod_perl tracks. But not in this case, unfortunately.

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/
signature.asc (application/pgp-signature, 259 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkz9Sg4ACgkQyzKhB4jDpaWIRwCfTyOhBX+znZG313q2P2U5Hk7i
v+MAni6yjbdYcyLn4w6RKrc+WhWKquNH
=XqGT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.