On Sun, Jul 1, 2012 at 11:48 AM, <[email protected]> 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.
