#include "httpd.h"
#include "http_config.h"
+#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
#include "util_mutex.h"
static int exipc_post_config(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{
- void *data; /* These two help ensure that we only init once. */
- const char *userdata_key;
apr_status_t rs;
exipc_data *base;
const char *tempdir;
/*
- * The following checks if this routine has been called before.
- * This is necessary because the parent process gets initialized
- * a couple of times as the server starts up, and we don't want
- * to create any more mutexes and shared memory segments than
- * we're actually going to use.
- *
- * The key needs to be unique for the entire web server, so put
- * the module name in it.
+ * Do nothing if we are not creating the final configuration.
+ * The parent process gets initialized a couple of times as the
+ * server starts up, and we don't want to create any more mutexes
+ * and shared memory segments than we're actually going to use.
*/
- userdata_key = "example_ipc_init_module";
- apr_pool_userdata_get(&data, userdata_key, s->process->pool);
- if (!data) {
- /*
- * If no data was found for our key, this must be the first
- * time the module is initialized. Put some data under that
- * key and return.
- */
- apr_pool_userdata_set((const void *) 1, userdata_key,
- apr_pool_cleanup_null, s->process->pool);
+ if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG)
return OK;
- } /* Kilroy was here */
/*
* The shared memory allocation routines take a file name.