httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: server config apr_table_t
Date Tue, 10 Oct 2006 16:19:02 GMT
On Tuesday 10 October 2006 16:43, Brian McQueen wrote:
> I am having a problem with keeping data in my apr_table_t.  During a
> request I obtain the server config structure, store something in there
> (some statistics which should have the scope of the life of the
> server), and then when the next request comes along, the data is gone!

The next request was handled by a different process.

> Here is how I'm initializing the table - here with a root pool:

The canonical way to create your pool would be to make a subpool
of pchild in a child_init hook.

> Neither of these lasts beyond the request, not even the one with
> static char strings:
>
> apr_table_set(server_config.approved_items, my_key, my_value);
> apr_table_set(server_config.approved_items, "key2", "value2");

These should be done under mutex, fwiw.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

Mime
View raw message