httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: Tear down of module on server stop
Date Fri, 07 Jun 2013 14:51:24 GMT

On 06/07/2013 08:19 AM, Sean Beck wrote:
> I'm looking through and example I found
> here<http://ctemplate.sourceforge.net/example/mod_example/mod_tplexample.c.html>and
> it says this about the method used by post_config():
> This routine is called to perform any module-specific fixing of header
> fields, et cetera. It is invoked just before any content-handler.
> That makes it seem like this is called every time a connection is made.
> That isn't what I want. I want to do set up only once for as long as the
> server is running. Would pre_config() be more suitable for that?
>
> Thanks
>

Sounds like it's the wrong description.  From http_config.h :

/**
  * Run the post_config function for each module
  * @param pconf The config pool
  * @param plog The logging streams pool
  * @param ptemp The temporary pool
  * @param s The list of server_recs
  * @return OK or DECLINED on success anything else is a error
  */
AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,
                                  apr_pool_t *ptemp,server_rec *s))


The post_config hook should happen when the child loads, and won't be 
associated with a specific request.  It happens after the config is 
loaded when HTTPD starts, potentially twice because of the way HTTPD 
loads.  Once done and HTTPD starts serving requests, it shouldn't be 
called again in that processes lifetime.

Joe
--
http://www.silverhawk.net/

Mime
View raw message