#define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 19990320
+#define MODULE_MAGIC_NUMBER_MAJOR 20000330
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
#define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR /* backward compat */
/* Useful for testing for features. */
* It's mainly important for the DSO facility
* (see also mod_so).
*/
-
+ void *(*pre_config) (ap_context_t *p, ap_context_t *plog, ap_context_t *ptemp, server_rec *s);
void *(*create_dir_config) (ap_context_t *p, char *dir);
void *(*merge_dir_config) (ap_context_t *p, void *base_conf, void *new_conf);
void *(*create_server_config) (ap_context_t *p, server_rec *s);
#define STANDARD_MODULE_STUFF this_module_needs_to_be_ported_to_apache_2_0
#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
+ MODULE_MAGIC_NUMBER_MINOR, \
+ -1, \
+ __FILE__, \
+ NULL, \
+ NULL, \
+ MODULE_MAGIC_COOKIE, \
+ NULL
+
+#define MPM20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
MODULE_MAGIC_NUMBER_MINOR, \
-1, \
__FILE__, \
/* Hooks */
DECLARE_HOOK(int,header_parser,(request_rec *))
-DECLARE_HOOK(void,pre_config,(ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp))
DECLARE_HOOK(void,post_config,
(ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp,server_rec *s))
DECLARE_HOOK(void,open_logs,
HOOK_STRUCT(
HOOK_LINK(header_parser)
- HOOK_LINK(pre_config)
HOOK_LINK(post_config)
HOOK_LINK(open_logs)
HOOK_LINK(child_init)
)
IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED)
-IMPLEMENT_HOOK_VOID(pre_config,(ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp),
- (pconf,plog,ptemp))
IMPLEMENT_HOOK_VOID(post_config,
(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s),
(pconf,plog,ptemp,s))
(*m->create_dir_config)(p, NULL));
}
+void run_pre_config(ap_context_t *p, ap_context_t *plog,
+ ap_context_t *ptemp, server_rec *s)
+{
+ module *m;
+
+ for (m = top_module; m; m = m->next)
+ if (m->pre_config)
+ (*m->pre_config) (p, plog, ptemp, s);
+ init_handlers(p);
+}
+
void ap_post_config_hook(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s)
{
ap_run_post_config(pconf,plog,ptemp,s);
destroy_and_exit_process(process, 1);
}
-
-
-
-
ap_context_t *g_pHookPool;
#ifdef WIN32
for example, to settle down. */
ap_server_root = def_server_root;
- ap_run_pre_config(pconf, plog, ptemp);
+ run_pre_config(pconf, plog, ptemp, server_conf);
server_conf = ap_read_config(process, ptemp, confname);
if (configtestonly) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Syntax OK\n");
}
ap_create_context(&ptemp, pconf);
ap_server_root = def_server_root;
- ap_run_pre_config(pconf, plog, ptemp);
+ run_pre_config(pconf, plog, ptemp, server_conf);
server_conf = ap_read_config(process, ptemp, confname);
ap_clear_pool(plog);
ap_run_open_logs(pconf, plog, ptemp, server_conf);
static void dexter_hooks(void)
{
- ap_hook_pre_config(dexter_pre_config, NULL, NULL, HOOK_MIDDLE);
INIT_SIGLIST()
one_process = 0;
}
};
module MODULE_VAR_EXPORT mpm_dexter_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ dexter_pre_config, /* run hook before the configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
static void mpmt_beos_hooks(void)
{
- ap_hook_pre_config(mpmt_beos_pre_config,NULL,NULL,HOOK_MIDDLE);
INIT_SIGLIST()
one_process = 0;
}
};
module MODULE_VAR_EXPORT mpm_mpmt_beos_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ mpmt_beos_pre_config, /* hook run before the configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
static void mpmt_pthread_hooks(void)
{
- ap_hook_pre_config(mpmt_pthread_pre_config,NULL,NULL,HOOK_MIDDLE);
INIT_SIGLIST()
one_process = 0;
}
};
module MODULE_VAR_EXPORT mpm_mpmt_pthread_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ mpmt_pthread_pre_config, /* run hook before the configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
static void prefork_hooks(void)
{
- ap_hook_pre_config(prefork_pre_config,NULL,NULL,HOOK_MIDDLE);
INIT_SIGLIST();
#ifdef AUX3
(void) set42sig();
};
module MODULE_VAR_EXPORT mpm_prefork_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ prefork_pre_config, /* run hook before the configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
static void spmt_os2_hooks(void)
{
- ap_hook_pre_config(spmt_os2_pre_config,NULL,NULL,HOOK_MIDDLE);
INIT_SIGLIST();
/* TODO: set one_process properly */ one_process = 0;
}
};
module MODULE_VAR_EXPORT mpm_spmt_os2_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ spmt_os2_pre_config, /* hook run before the configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
// INIT_SIGLIST()
one_process = 0;
/* Configuration hooks implemented by http_config.c ... */
- ap_hook_pre_config(winnt_pre_config, NULL, NULL, HOOK_MIDDLE);
}
/*
};
module MODULE_VAR_EXPORT mpm_winnt_module = {
- STANDARD20_MODULE_STUFF,
+ MPM20_MODULE_STUFF,
+ winnt_pre_config, /* hook run before configuration is read */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */