Re: $r->document_root

[prev] [thread] [next] [Date index for 2005/02/19]

From: Stas Bekman
Subject: Re: $r->document_root
Date: 17:21 on 19 Feb 2005
Geoffrey Young wrote:

> take a look at the implementation in mp1 - why won't something like that
> work, so long as we're in prefork?

i.e. create a special scalar (quoting from mp1):

         SV *doc_root = perl_get_sv("Apache::Server::DocumentRoot", TRUE);
         sv_setsv(doc_root, ST(1));
         conf->ap_document_root = SvPVX(doc_root);

Joe Schaefer wrote:

 > Why not add a request pool cleanup that just restores the original
 > pointer?

Either will work, thanks folks.

The question is whether we want to make that docroot change persistent 
across requests [1] or per-request[2]. Geoff's proposal matches the former 
[1]behavior, whereas Joe's the latter[2].

I tend to think that per-request[2] is the sane solution. That's because 
you can never know whether this value was already modified or not when you 
hit a new process. So you will always try to change it, in which case 
per-request[2] makes the most sense.

the only cons is that it's different from mp1 behavior, but as the above 
explains it makes no difference (I believe).

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

(message missing)

$r->document_root
Cahill, Earl 23:14 on 14 Feb 2005

Re: $r->document_root
Geoffrey Young 23:21 on 14 Feb 2005

Re: $r->document_root
Geoffrey Young 23:26 on 14 Feb 2005

RE: $r->document_root
Cahill, Earl 20:43 on 15 Feb 2005

Re: $r->document_root
Geoffrey Young 21:10 on 15 Feb 2005

Re: $r->document_root
Stas Bekman 01:48 on 19 Feb 2005

Re: $r->document_root
Stas Bekman 02:02 on 19 Feb 2005

Re: $r->document_root
Geoffrey Young 13:54 on 19 Feb 2005

Re: $r->document_root
Stas Bekman 17:21 on 19 Feb 2005

Re: $r->document_root
Joe Schaefer 14:12 on 19 Feb 2005

Re: $r->document_root
Geoffrey Young 05:26 on 20 Feb 2005

Re: $r->document_root
Stas Bekman 01:29 on 21 Feb 2005

Re: $r->document_root
Joe Schaefer 02:38 on 21 Feb 2005

Re: $r->document_root
Stas Bekman 02:43 on 21 Feb 2005

Generated at 12:48 on 22 Feb 2005 by mariachi v0.52