]> granicus.if.org Git - apache/commitdiff
Pass the process_rec to the MPM to allow rewriting of the args list.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 27 May 2000 06:22:55 +0000 (06:22 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 27 May 2000 06:22:55 +0000 (06:22 +0000)
  Especially necessary under Win32, or other non-unix front ends where
  oddball arguments might be required, but without causing a mess in
  http_main.c.

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

include/http_config.h
server/main.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
server/mpm/winnt/mpm_winnt.c

index 810913a466d0d6b06c3fa6ee235fce760c8be393..4b83080d705107b47cfca4bfa177632eb4db8867 100644 (file)
@@ -224,6 +224,7 @@ typedef struct module_struct {
                                  * It's mainly important for the DSO facility
                                  * (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);
@@ -269,6 +270,7 @@ typedef struct module_struct {
                                NULL, \
                                NULL, \
                                MODULE_MAGIC_COOKIE, \
+                                NULL, \
                                 NULL
 
 #define MPM20_MODULE_STUFF     MODULE_MAGIC_NUMBER_MAJOR, \
@@ -382,6 +384,7 @@ void ap_show_modules(void);
 server_rec *ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name);
 void ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
 void ap_child_init_hook(ap_pool_t *pchild, server_rec *s);
+void ap_run_rewrite_args(process_rec *process);
 void ap_run_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
 
 void ap_register_hooks(module *m);
index d62f001f267de312b26646bddb85e6b84826d02e..f6119492ea05285d6860f605bf895fd31858e7ab 100644 (file)
 #include "apr_getopt.h"
 #include "ap_mpm.h"
 
-const char *ap_server_argv0;
-
-const char *ap_server_root;
-
-ap_array_header_t *ap_server_pre_read_config;
-ap_array_header_t *ap_server_post_read_config;
-ap_array_header_t *ap_server_config_defines;
-
 /* XXX - We should be able to grab the per-MPM settings here too */
 static void show_compile_settings(void)
 {
@@ -280,8 +272,6 @@ static void usage(process_rec *process)
     destroy_and_exit_process(process, 1);
 }
 
-ap_pool_t *g_pHookPool;
-
 #ifdef WIN32
 API_EXPORT(int) apache_main(int argc, char *argv[])
 #else
@@ -317,8 +307,6 @@ API_EXPORT(int)        main(int argc, char *argv[])
 
     ap_util_uri_init();
 
-    g_pHookPool=pconf;
-
     ap_setup_prelinked_modules(process);
 
     ap_create_pool(&pcommands, pglobal);
@@ -326,7 +314,9 @@ API_EXPORT(int)        main(int argc, char *argv[])
     ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
     ap_server_config_defines   = ap_make_array(pcommands, 1, sizeof(char *));
 
-    while (ap_getopt(argc, argv, "C:c:d:f:k:vVlLth", &c, pcommands) == APR_SUCCESS) {
+    ap_run_rewrite_args(process);
+
+    while (ap_getopt(argc, argv, "C:c:D:d:f:vVlLth?", &c, pcommands) == APR_SUCCESS) {
         char **new;
         switch (c) {
        case 'c':
@@ -340,6 +330,10 @@ API_EXPORT(int)        main(int argc, char *argv[])
        case 'd':
            def_server_root = ap_optarg;
            break;
+       case 'D':
+           new = (char **)ap_push_array(ap_server_config_defines);
+           *new = ap_pstrdup(pcommands, ap_optarg);
+           break;
        case 'f':
            confname = ap_optarg;
            break;
@@ -359,9 +353,8 @@ API_EXPORT(int)        main(int argc, char *argv[])
        case 't':
            configtestonly = 1;
            break;
-       case 'h':
-           usage(process);
        case '?':
+       case 'h':
            usage(process);
        }
     }
index 4eee4638837669c35dd2afa0c263f063b6d66d45..6b6a73cc19f2629173b146e4e67915f40193ec64 100644 (file)
@@ -1458,6 +1458,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR 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 */
index 879f38e32e975c766acc78ad131bfa78973b1773..260b05958a0306212447ba4cb1e4a7134cc6df02 100644 (file)
@@ -1261,6 +1261,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR 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 */
index 4207e96974e4a9640700c824cf91f985d2711730..7b9d557de448816fab40b3532168951ffa5fa364 100644 (file)
@@ -1477,6 +1477,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR 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 */
index 755b10571f5ec4856a2cf510e32a0d09ac14a4b5..e2e3033c829940c79006e9b80d72d6f3c5389644 100644 (file)
@@ -2436,6 +2436,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR 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 */
index ea9061480c940cfb47e35b057a99e9b2f86049e8..f35616d5f0aca40a9fc529f83af0009d5dac95e9 100644 (file)
@@ -1671,6 +1671,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR 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 */
index 698a2db7f5505a4aebe5972c82ab6e14be40fc55..99c12027475ba60d5d9f76dd4cb74cdc061fd1d7 100644 (file)
@@ -1969,6 +1969,7 @@ LISTEN_COMMANDS
 
 module MODULE_EXPORT_VAR mpm_winnt_module = {
     MPM20_MODULE_STUFF,
+    NULL,                       /* hook run before arguments are parsed */
     winnt_pre_config,           /* hook run before configuration is read */
     NULL,                      /* create per-directory config structure */
     NULL,                      /* merge per-directory config structures */