]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add pre_config hooks back in for all modules. This is important for the
authorRyan Bloom <rbb@apache.org>
Fri, 2 Jun 2000 15:33:20 +0000 (15:33 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 2 Jun 2000 15:33:20 +0000 (15:33 +0000)
server tokens code that is coming soon.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85378 13f79535-47bb-0310-9956-ffa450edef68

include/http_config.h
server/config.c
server/mpm/dexter/dexter.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c

index c97681f1424562cad75b55e5fdb2c615a90f8b16..efe0af0368decd945cb55c5772197f4ce97e9e5a 100644 (file)
@@ -226,7 +226,6 @@ typedef struct module_struct {
                                  * (see also mod_so).
                                  */
     void (*rewrite_args) (process_rec *process);
-    void (*pre_config) (ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
     void *(*create_dir_config) (ap_pool_t *p, char *dir);
     void *(*merge_dir_config) (ap_pool_t *p, void *base_conf, void *new_conf);
     void *(*create_server_config) (ap_pool_t *p, server_rec *s);
@@ -271,8 +270,7 @@ typedef struct module_struct {
                                NULL, \
                                NULL, \
                                MODULE_MAGIC_COOKIE, \
-                                NULL, \
-                                NULL
+                                NULL      /* rewrite args spot */
 
 #define MPM20_MODULE_STUFF     MODULE_MAGIC_NUMBER_MAJOR, \
                                MODULE_MAGIC_NUMBER_MINOR, \
@@ -383,10 +381,9 @@ API_EXPORT(void) ap_setup_prelinked_modules(process_rec *process);
 API_EXPORT(void) ap_show_directives(void);
 API_EXPORT(void) ap_show_modules(void);
 API_EXPORT(server_rec*) ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name);
+API_EXPORT(void) ap_pre_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
 API_EXPORT(void) ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
 API_EXPORT(void) ap_run_rewrite_args(process_rec *process);
-API_EXPORT(void) ap_run_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
-
 API_EXPORT(void) ap_register_hooks(module *m);
 
 /* For http_request.c... */
@@ -429,6 +426,8 @@ CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, cons
 
   /* Hooks */
 AP_DECLARE_HOOK(int,header_parser,(request_rec *))
+AP_DECLARE_HOOK(void,pre_config,
+            (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp))
 AP_DECLARE_HOOK(void,post_config,
             (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s))
 AP_DECLARE_HOOK(void,open_logs,
index 743b3a79ba75c9c13a265378d5e04c990d12e0a8..4722425183d84d5951a347baa719804df6521331 100644 (file)
@@ -95,6 +95,7 @@ API_VAR_EXPORT ap_array_header_t *ap_server_config_defines;
 
 AP_HOOK_STRUCT(
            AP_HOOK_LINK(header_parser)
+           AP_HOOK_LINK(pre_config)
            AP_HOOK_LINK(post_config)
            AP_HOOK_LINK(open_logs)
            AP_HOOK_LINK(child_init)
@@ -102,6 +103,9 @@ AP_HOOK_STRUCT(
 
 AP_IMPLEMENT_HOOK_RUN_ALL(int,header_parser,
                           (request_rec *r),(r),OK,DECLINED)
+AP_IMPLEMENT_HOOK_VOID(pre_config,
+                      (ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp),
+                       (pconf,plog,ptemp))
 AP_IMPLEMENT_HOOK_VOID(post_config,
                       (ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp,
                         server_rec *s),(pconf,plog,ptemp,s))
@@ -1584,16 +1588,6 @@ API_EXPORT(void) ap_run_rewrite_args(process_rec *process)
             (*m->rewrite_args) (process);
 }
 
-API_EXPORT(void) ap_run_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp)
-{
-    module *m;
-
-    for (m = top_module; m; m = m->next)
-        if (m->pre_config)
-            (*m->pre_config) (p, plog, ptemp);
-    init_handlers(p);
-}
-
 API_EXPORT(void) ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s)
 {
     ap_run_post_config(pconf,plog,ptemp,s); 
index 32c1db515da368aa210612060b87635544c7073f..f360585e12b96a8ad9c7ac8c4e8cee5c5bbaf195 100644 (file)
@@ -1251,6 +1251,8 @@ static void dexter_hooks(void)
 {
     INIT_SIGLIST()
     one_process = 0;
+
+    ap_hook_pre_config(dexter_pre_config, NULL, NULL, AP_HOOK_MIDDLE); 
 }
 
 static const char *set_pidfile(cmd_parms *cmd, void *dummy, char *arg) 
@@ -1459,7 +1461,6 @@ LISTEN_COMMANDS
 module MODULE_VAR_EXPORT mpm_dexter_module = {
     MPM20_MODULE_STUFF,
     NULL,                       /* hook to run before apache parses args */
-    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 */
index 5e27dd6fd427fc13a8beef20a626ba2e19176e46..e9791b8580240299dc2b4a4a0738811f846ee4cc 100644 (file)
@@ -1066,6 +1066,8 @@ static void mpmt_beos_hooks(void)
 {
     INIT_SIGLIST()
     one_process = 0;
+
+    ap_hook_pre_config(mpmt_beos_pre_config, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 
@@ -1262,7 +1264,6 @@ LISTEN_COMMANDS
 module MODULE_VAR_EXPORT mpm_mpmt_beos_module = {
     MPM20_MODULE_STUFF,
     NULL,                       /* hook to run before apache parses args */
-    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 */
index fdf140c2d6acb338859828e4766d8e7d12c8756e..cb1278e9906391d8955a459e013a26bd6e650b74 100644 (file)
@@ -1284,6 +1284,8 @@ static void mpmt_pthread_hooks(void)
 {
     INIT_SIGLIST()
     one_process = 0;
+
+    ap_hook_pre_config(mpmt_pthread_pre_config, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 
@@ -1478,7 +1480,6 @@ LISTEN_COMMANDS
 module MODULE_VAR_EXPORT mpm_mpmt_pthread_module = {
     MPM20_MODULE_STUFF,
     NULL,                       /* hook to run before apache parses args */
-    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 */
index 9b61016bdae9d7bc2b87f62045a9410324dc46ec..79dd2c392660271327e6b34b30736081d95f04ab 100644 (file)
@@ -2147,6 +2147,8 @@ static void prefork_hooks(void)
     (void) set42sig();
 #endif
     /* TODO: set one_process properly */ one_process = 0;
+
+    ap_hook_pre_config(prefork_pre_config, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 static const char *set_pidfile(cmd_parms *cmd, void *dummy, char *arg) 
@@ -2437,7 +2439,6 @@ LISTEN_COMMANDS
 module MODULE_VAR_EXPORT mpm_prefork_module = {
     MPM20_MODULE_STUFF,
     NULL,                       /* hook to run before apache parses args */
-    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 */
index 1eb1c1d79ed826d597f7be28eb4854cd5a162347..832a27fc6ede503b88e2ab2a45e5977e36ef7d3f 100644 (file)
@@ -1521,6 +1521,8 @@ static void spmt_os2_hooks(void)
 {
     INIT_SIGLIST();
     /* TODO: set one_process properly */ one_process = 0;
+
+    ap_hook_pre_config(spmt_os2_pre_config, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 static const char *set_pidfile(cmd_parms *cmd, void *dummy, char *arg) 
@@ -1672,7 +1674,6 @@ LISTEN_COMMANDS
 module MODULE_VAR_EXPORT mpm_spmt_os2_module = {
     MPM20_MODULE_STUFF,
     NULL,                       /* hook to run before apache parses args */
-    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 */