httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Caruso <i...@simonecaruso.com>
Subject Can't access module config from handler function
Date Sat, 13 Aug 2011 16:06:03 GMT
Hi all,

im writing a module that stores data in a shared memory to set php conf values
and other in 'traslate_name' hook.. it works fine.

I decided to output the shm content within an http request using an handler
(like mod_status).

In configuration i have this:
<Location /output/>
sethandler "module_test_output"
</Location>

I setup the shm in post_config hook:
ap_hook_post_config(post_config_hook, NULL, NULL, APR_HOOK_REALLY_FIRST);

ending with the "post_config" hook function like this:
   ...
   conf->cache = apr_rmm_addr_get(rmm_addr, offset);
   conf->test_string = "costant string";
   return OK;
}


Within the translate_name hook the module access conf->cache correctly and
shm+rmm works well.

Problems come When i use "ap_get_module_config" within my 'shmoutput_handler':
conf->cache AND conf->test_string gives me a null pointers cauing segfaults.

My module is very similar to mod_shm_counter:
http://www.codemass.com/mod_shm_counter/downloads/mod_shm_counter.c

but my handler hook don't work.... do someone have an idea?

Thanks!


Mime
View raw message