httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian McQueen" <>
Subject server config apr_table_t
Date Tue, 10 Oct 2006 15:43:32 GMT
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!
 During the request I store it and retrieve it, just to make sure the
mechanism is correct with no problems, but when the request is gone,
the data is gone too.  Obviously it seems to be a request pool related
issue, but I tried to get around that by being very specific about
which pool to use.  I've made a sub-pool of the pool that created the
server config structure and saved that within the server config
structure.  I've also made sure the tables are "made" with this very
same pool.  What is happening to my data?  I've even created a brand
new root pool with the same results.  I'm using the apr_tables.h
techniques like this:

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

ASSERT(apr_pool_create(&server_config_p->stats_pool, NULL) == APR_SUCCESS);

server_config_p->approved_items =
apr_table_make(server_config_p->stats_pool, 500);

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");

During the request I can loop over the table with apr_table_do and
print out all of the data, but by the next request its all gone.

Brian McQueen

View raw message