httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Can't access module config from handler function
Date Sat, 13 Aug 2011 16:44:13 GMT

On 13 Aug 2011, at 17:06, Simone Caruso wrote:

> 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>

Using it in a <Location> would suggest it's per_dir config.
> I setup the shm in post_config hook:
> ap_hook_post_config(post_config_hook, NULL, NULL, APR_HOOK_REALLY_FIRST);

... but per_dir config for your location doesn't exist at post_config time!

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

because the config it sees hasn't been merged for the <location>

I suspect you're using the wrong configuration hierarchy for the job at hand.
If not, then the fix might be as simple as a merge_config function.

There's a very brief (and ancient) piece at
In the book there's a whole chapter, which is both substantially expanded and
updated from that.

Nick Kew
View raw message