httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xavier Beaudouin <k...@oav.net>
Subject Re: How to change ap_document_root variable from a apache2 module ?
Date Sat, 08 Jan 2005 19:38:11 GMT

Le 3 janv. 05, à 21:36, Geoffrey Young a écrit :

>
>>>> This can be done quite safely in Apache1, by the way.
>>>
>>> I don't believe it can. Code?
>>
>>
>> Well, since you don't need to worry about thread safety as long as 
>> you set
>> it on every request, or reset it after each request you are fine.
>> Something like:
>>
>>   foo->old = ap_document_root(r);
>>   conf = ap_get_module_config(s->module_config, &core_module);
>>   conf->ap_document_root = new;
>>   ap_register_cleanup(r->pool, foo, my_cleanup, ap_null_cleanup);
>>
>> Then set it back to foo->old in my_cleanup().

Thanks for that :) And also for mod_perl coders that gave me a good 
practical example
for add this into mod_vhs :)

Now this works ;)

Another point is how to "isolate" a non thread-safe function inside an 
apache2 module
using if possible apr thread and mutex functions. What is the "right 
rules" about that ?

Many thanks,
/Xavier

--
Xavier Beaudouin - Unix System Administrator & Projects Leader.
President of Kazar Organization : http://www.kazar.net/
Please visit http://caudium.net/, home of Caudium & Camas projects


Mime
View raw message