/**
* Add a module to the server
- * @param m the module structure of the module to add
- * @deffunc void ap_add_module(module *m)
+ * @param m The module structure of the module to add
+ * @param p The pool of the same lifetime as the module
+ * @deffunc void ap_add_module(module *m, apr_pool_t *p)
*/
-AP_DECLARE(void) ap_add_module(module *m);
+AP_DECLARE(void) ap_add_module(module *m, apr_pool_t *p);
+
/**
* Remove a module from the server. There are some caveats:
* when the module is removed, its slot is lost so all the current
AP_DECLARE(void) ap_remove_module(module *m);
/**
* Add a module to the chained modules list and the list of loaded modules
- * @param m the module structure of the module to add
- * @deffunc void ap_add_loaded_module(module *m)
+ * @param m The module structure of the module to add
+ * @param p The pool with the same lifetime as the module
+ * @deffunc void ap_add_loaded_module(module *m, apr_pool_t *p)
*/
-AP_DECLARE(void) ap_add_loaded_module(module *mod);
+AP_DECLARE(void) ap_add_loaded_module(module *mod, apr_pool_t *p);
/**
* Remove a module fromthe chained modules list and the list of loaded modules
* @param m the module structure of the module to remove
* Add a module to the list of loaded module based on the name of the
* module
* @param name The name of the module
+ * @param p The pool valid for the lifetime of the module
* @return 1 on success, 0 on failure
- * @deffunc int ap_add_named_module(const char *name)
+ * @deffunc int ap_add_named_module(const char *name, apr_pool_t *p)
*/
-AP_DECLARE(int) ap_add_named_module(const char *name);
+AP_DECLARE(int) ap_add_named_module(const char *name, apr_pool_t *p);
/**
* Clear all of the modules from the loaded module list
- * @deffunc void ap_add_named_module(void)
+ * @param p The pool valid for the lifetime of the modules
+ * @deffunc void ap_add_named_module(apr_pool_t *p)
*/
-AP_DECLARE(void) ap_clear_module_list(void);
+AP_DECLARE(void) ap_clear_module_list(apr_pool_t *p);
/**
* Find the name of the specified module
* @param m The module to get the name for
/**
* Run the register hooks function for a specified module
* @param m The module to run the register hooks function fo
- * @deffunc void ap_register_hooks(module *m)
+ * @param p The pool valid for the lifetime of the module
+ * @deffunc void ap_register_hooks(module *m, apr_pool_t *p)
*/
-AP_DECLARE(void) ap_register_hooks(module *m);
+AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p);
/**
* Setup all virtual hosts
return err;
}
- if (!ap_add_named_module(arg)) {
+ if (!ap_add_named_module(arg, cmd->pool)) {
return apr_pstrcat(cmd->pool, "Cannot add module via name '", arg,
"': not in list of loaded modules", NULL);
}
return err;
}
- ap_clear_module_list();
+ ap_clear_module_list(cmd->pool);
*(ap_directive_t **)dummy = NULL;
return NULL;
}
/*
* Add this module to the Apache core structures
*/
- ap_add_loaded_module(modp);
+ ap_add_loaded_module(modp, cmd->pool);
/*
* Register a cleanup in the config apr_pool_t (normally pconf). When
return 0;
}
-AP_DECLARE(void) ap_register_hooks(module *m)
- {
+AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p)
+{
if(m->register_hooks)
- {
+ {
if(getenv("SHOW_HOOKS"))
- {
+ {
printf("Registering hooks for %s\n",m->name);
ap_debug_module_hooks=1;
- }
- ap_current_hooking_module=m->name;
- m->register_hooks();
}
+ ap_current_hooking_module=m->name;
+ m->register_hooks(p);
}
+}
/* One-time setup for precompiled modules --- NOT to be done on restart */
-AP_DECLARE(void) ap_add_module(module *m)
+AP_DECLARE(void) ap_add_module(module *m, apr_pool_t *p)
{
/* This could be called from an AddModule httpd.conf command,
* after the file has been linked and the module structure within it
}
#endif /*_OSD_POSIX*/
- /* FIXME: is this the right place to call this? */
- ap_register_hooks(m);
+ /* FIXME: is this the right place to call this?
+ * It doesn't appear to be
+ */
+ ap_register_hooks(m, p);
}
/*
total_modules--;
}
-AP_DECLARE(void) ap_add_loaded_module(module *mod)
+AP_DECLARE(void) ap_add_loaded_module(module *mod, apr_pool_t *p)
{
module **m;
/*
* Add module pointer to top of chained module list
*/
- ap_add_module(mod);
+ ap_add_module(mod, p);
/*
* And module pointer to list of loaded modules
* Initialize chain of linked (=activate) modules
*/
for (m = ap_prelinked_modules; *m != NULL; m++)
- ap_add_module(*m);
+ ap_add_module(*m, process->pconf);
ap_sort_hooks();
}
}
/* Add a named module. Returns 1 if module found, 0 otherwise. */
-AP_DECLARE(int) ap_add_named_module(const char *name)
+AP_DECLARE(int) ap_add_named_module(const char *name, apr_pool_t *p)
{
module *modp;
int i = 0;
if (strcmp(modp->name, name) == 0) {
/* Only add modules that are not already enabled. */
if (modp->next == NULL) {
- ap_add_module(modp);
+ ap_add_module(modp, p);
}
return 1;
}
}
/* Clear the internal list of modules, in preparation for starting over. */
-AP_DECLARE(void) ap_clear_module_list()
+AP_DECLARE(void) ap_clear_module_list(apr_pool_t *p)
{
module **m = &top_module;
module **next_m;
}
/* This is required; so we add it always. */
- ap_add_named_module("http_core.c");
+ ap_add_named_module("http_core.c", p);
}
/*****************************************************************
ap_hook_deregister_all();
apr_clear_pool(pconf);
for (mod = ap_prelinked_modules; *mod != NULL; mod++) {
- ap_register_hooks(*mod);
+ ap_register_hooks(*mod, pconf);
}
/* This is a hack until we finish the code so that it only reads
* the config file once and just operates on the tree already in