On Wed, Aug 18, 2004 at 10:59:25AM -0700, Stas Bekman wrote:
> Glenn Strauss wrote:
> >Apache caches the server_rec, so as Stas said, modifying it affects
> >things globally, and across the request.  In C, if I wanted to
> >local'ize the server_rec for the request, I would make a copy of the
> >server_rec, store it in r->server, and then modify its contents
> >(top-level only) through r->server.
> >
> >Stas: is there a way to do this in mod_perl?  What do you think of
> >local'izing the server_rec when an application attempts to make
> >request-specific changes?  There would need to be a clear API for
> >making request-specific or global changes.  (Changes through
> >r->server instead of directly through the global server rec,
> >e.g. in the main httpd.conf)  Maybe pass $r as an arg to the
> >server_rec method if you want it local'ized?  Just musing ...
> 
> Hmm, how do you see that idea working, Glenn? even if we could localize 
> server_rec, the rest of the Apache will still see the un-localized one, so 
> we don't achieve much. If you wanted to change things just for the 
> mod_perl handlers scope, just stick a new docroot in some singleton and 
> use that in your code.

I'm talking about copying the entire server_rec of r->server wholesale
and placing a copy in r->server and then modifying the copy.
(I'm talking at the C level, here.)  Any filters that reference r
would see the new copy in r->server.

All of this is theoretical, mind you.

Cheers,
Glenn

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to