httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: Module register_hooks and config seems to be called twice when Apache starts up?
Date Sun, 01 Jul 2012 15:56:10 GMT
On Sun, Jul 1, 2012 at 11:48 AM,  <ohaya@cox.net> wrote:
> Hi,
>
> I have the following in my module:
>
>
> module AP_MODULE_DECLARE_DATA my_module =
> {
>     STANDARD20_MODULE_STUFF,
>     NULL,                                                  /*
dir config creater */
>     NULL,                                                  /*
dir merger --- default is to override */
>     create_mymodule_config,                       /* server config */
>     NULL,                       /* merge server configs */
>     txt_cmds,                       /* command apr_table_t */
>     register_hooks              /* register hooks */
> };
>
>
> I also have some printf statements at the beginning of the create_mymodule_config() and
register_hooks() function, and when I start Apache, it seems like it's calling both of those
functions twice.
>
> Can anyone tell why that might be, and is it possible to have Apache onlyh call those
functions once during startup?

Apache parses the config twice at startup (once as a dry run).  Some
modules use apr_pool_userdata_set on s->process->pool  to recognize
the first pass and avoid heavy lifting the first pass.

Mime
View raw message