dgaudet 99/07/27 05:05:15
Modified: mpm/src/include http_config.h mpm/src/main http_config.c http_core.c http_main.c http_vhost.c mpm/src/modules/mpm/dexter dexter.c mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/mpm/spmt_os2 spmt_os2.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_cgi.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_include.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: - get rid of pre_command_line_hook ... use register_hooks for this purpose - get rid of optreset... screw -D, use environment variables ONE_PROCESS, SHOW_HOOKS, DUMP_VHOSTS, ... at least it builds this way :) Revision Changes Path 1.11 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_config.h 1999/07/24 18:38:37 1.10 +++ http_config.h 1999/07/27 12:04:59 1.11 @@ -211,7 +211,6 @@ * (see also mod_so). */ - void (*pre_command_line)(pool *pcommands); void (*pre_config)(pool *pconf, pool *plog, pool *ptemp); void (*open_logs)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); @@ -334,7 +333,6 @@ void ap_setup_prelinked_modules(void); void ap_show_directives(void); void ap_show_modules(void); -void ap_pre_command_line_hook(pool *pcommands); void ap_pre_config_hook(pool *pconf, pool *plog, pool *ptemp); server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, const char *config_name); void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); 1.14 +1 -10 apache-2.0/mpm/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- http_config.c 1999/07/24 18:38:46 1.13 +++ http_config.c 1999/07/27 12:05:00 1.14 @@ -496,7 +496,7 @@ { if(m->register_hooks) { - if(ap_exists_config_define("SHOW_HOOKS")) + if(getenv("SHOW_HOOKS")) { printf("Registering hooks for %s\n",m->name); g_bDebugHooks=1; @@ -1435,15 +1435,6 @@ if (m->create_dir_config) ap_set_module_config(s->lookup_defaults, m, (*m->create_dir_config)(p, NULL)); -} - -void ap_pre_command_line_hook(pool *pcommands) -{ - module *m; - - for (m = top_module; m; m = m->next) - if (m->pre_command_line) - (*m->pre_command_line) (pcommands); } void ap_pre_config_hook(pool *pconf, pool *plog, pool *ptemp) 1.12 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_core.c 1999/07/25 14:24:01 1.11 +++ http_core.c 1999/07/27 12:05:00 1.12 @@ -2649,7 +2649,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ core_open_logs, /* open_logs */ 1.5 +0 -15 apache-2.0/mpm/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/main/http_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_main.c 1999/07/10 13:32:47 1.4 +++ http_main.c 1999/07/27 12:05:00 1.5 @@ -247,9 +247,7 @@ pool *ptemp; /* Pool for temporart config stuff */ pool *pcommands; /* Pool for -C and -c switches */ extern char *optarg; - extern int optind,optreset; - /* TODO: PATHSEPARATOR should be one of the os defines */ #define PATHSEPARATOR '/' if ((s = strrchr(argv[0], PATHSEPARATOR)) != NULL) { @@ -270,21 +268,8 @@ ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *)); ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *)); - while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:th")) != -1) { - char **new; - switch (c) { - case 'D': - new = (char **)ap_push_array(ap_server_config_defines); - *new = ap_pstrdup(pcommands, optarg); - break; - } - } - ap_setup_prelinked_modules(); - ap_pre_command_line_hook(pcommands); - - optind=optreset=1; while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:th")) != -1) { char **new; switch (c) { 1.3 +1 -1 apache-2.0/mpm/src/main/http_vhost.c Index: http_vhost.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/main/http_vhost.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- http_vhost.c 1999/06/20 11:19:46 1.2 +++ http_vhost.c 1999/07/27 12:05:00 1.3 @@ -654,7 +654,7 @@ #ifdef IPHASH_STATISTICS dump_iphash_statistics(main_s); #endif - if (ap_exists_config_define("DUMP_VHOSTS")) { + if (getenv("DUMP_VHOSTS")) { dump_vhost_config(STDERR_FILENO); } } 1.9 +3 -4 apache-2.0/mpm/src/modules/mpm/dexter/dexter.c Index: dexter.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/mpm/dexter/dexter.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- dexter.c 1999/07/26 03:28:15 1.8 +++ dexter.c 1999/07/27 12:05:02 1.9 @@ -1443,7 +1443,7 @@ return 0; } -static void dexter_pre_command_line(pool *pcommands) +static void dexter_hooks(void) { INIT_SIGLIST() one_process = 0; @@ -1453,7 +1453,7 @@ { static int restart_num = 0; - one_process = ap_exists_config_define("ONE_PROCESS"); + one_process = getenv("ONE_PROCESS"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { @@ -1691,7 +1691,6 @@ module MODULE_VAR_EXPORT mpm_dexter_module = { STANDARD20_MODULE_STUFF, - dexter_pre_command_line, /* pre_command_line */ dexter_pre_config, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ @@ -1704,7 +1703,7 @@ NULL, /* handlers */ NULL, /* check auth */ NULL, /* check access */ - NULL /* register hooks */ + dexter_hooks /* register_hooks */ }; /* force Expat to be linked into the server executable */ 1.13 +3 -4 apache-2.0/mpm/src/modules/mpm/mpmt_pthread/mpmt_pthread.c Index: mpmt_pthread.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mpmt_pthread.c 1999/07/26 03:28:14 1.12 +++ mpmt_pthread.c 1999/07/27 12:05:03 1.13 @@ -1510,7 +1510,7 @@ return 0; } -static void mpmt_pthread_pre_command_line(pool *pcommands) +static void mpmt_pthread_hooks(void) { INIT_SIGLIST() one_process = 0; @@ -1520,7 +1520,7 @@ { static int restart_num = 0; - one_process = ap_exists_config_define("ONE_PROCESS"); + one_process = getenv("ONE_PROCESS"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { @@ -1764,7 +1764,6 @@ module MODULE_VAR_EXPORT mpm_mpmt_pthread_module = { STANDARD20_MODULE_STUFF, - mpmt_pthread_pre_command_line, /* pre_command_line */ mpmt_pthread_pre_config, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ @@ -1777,7 +1776,7 @@ NULL, /* handlers */ NULL, /* check auth */ NULL, /* check access */ - NULL /* register hooks */ + mpmt_pthread_hooks /* register_hooks */ }; /* force Expat to be linked into the server executable */ 1.19 +3 -4 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- prefork.c 1999/07/25 14:03:16 1.18 +++ prefork.c 1999/07/27 12:05:04 1.19 @@ -2859,7 +2859,7 @@ return 0; } -static void prefork_pre_command_line(pool *pcommands) +static void prefork_hooks(void) { INIT_SIGLIST(); #ifdef AUX3 @@ -2872,7 +2872,7 @@ { static int restart_num = 0; - one_process = ap_exists_config_define("ONE_PROCESS"); + one_process = getenv("ONE_PROCESS"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { @@ -3083,7 +3083,6 @@ module MODULE_VAR_EXPORT mpm_prefork_module = { STANDARD20_MODULE_STUFF, - prefork_pre_command_line, /* pre_command_line */ prefork_pre_config, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ @@ -3096,5 +3095,5 @@ NULL, /* handlers */ NULL, /* check auth */ NULL, /* check access */ - NULL /* register hooks */ + prefork_hooks, /* register hooks */ }; 1.6 +3 -4 apache-2.0/mpm/src/modules/mpm/spmt_os2/spmt_os2.c Index: spmt_os2.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/mpm/spmt_os2/spmt_os2.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- spmt_os2.c 1999/07/19 07:32:20 1.5 +++ spmt_os2.c 1999/07/27 12:05:05 1.6 @@ -1603,7 +1603,7 @@ return 0; } -static void spmt_os2_pre_command_line(pool *pcommands) +static void spmt_os2_hooks(void) { INIT_SIGLIST(); /* TODO: set one_process properly */ one_process = 0; @@ -1611,7 +1611,7 @@ static void spmt_os2_pre_config(pool *pconf, pool *plog, pool *ptemp) { - one_process = ap_exists_config_define("ONE_PROCESS"); + one_process = getenv("ONE_PROCESS"); is_graceful = 0; ap_listen_pre_config(); @@ -1792,7 +1792,6 @@ module MODULE_VAR_EXPORT mpm_spmt_os2_module = { STANDARD20_MODULE_STUFF, - spmt_os2_pre_command_line, /* pre_command_line */ spmt_os2_pre_config, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ @@ -1807,5 +1806,5 @@ NULL, /* check access */ NULL, /* type_checker */ NULL, /* pre-run fixups */ - NULL /* register hooks */ + spmt_os2_hooks, /* register_hooks */ }; 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_access.c 1999/07/24 18:39:01 1.8 +++ mod_access.c 1999/07/27 12:05:06 1.9 @@ -389,7 +389,6 @@ module MODULE_VAR_EXPORT access_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.8 +0 -1 apache-2.0/mpm/src/modules/standard/mod_actions.c Index: mod_actions.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_actions.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mod_actions.c 1999/07/24 18:39:01 1.7 +++ mod_actions.c 1999/07/27 12:05:06 1.8 @@ -211,7 +211,6 @@ module action_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_alias.c 1999/07/24 18:39:02 1.9 +++ mod_alias.c 1999/07/27 12:05:07 1.10 @@ -406,7 +406,6 @@ module MODULE_VAR_EXPORT alias_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_asis.c Index: mod_asis.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_asis.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_asis.c 1999/07/24 18:39:02 1.8 +++ mod_asis.c 1999/07/27 12:05:07 1.9 @@ -126,7 +126,6 @@ module MODULE_VAR_EXPORT asis_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_auth.c 1999/07/24 18:39:02 1.8 +++ mod_auth.c 1999/07/27 12:05:07 1.9 @@ -318,7 +318,6 @@ module MODULE_VAR_EXPORT auth_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_autoindex.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_autoindex.c 1999/07/24 18:39:02 1.8 +++ mod_autoindex.c 1999/07/27 12:05:07 1.9 @@ -1650,7 +1650,6 @@ module MODULE_VAR_EXPORT autoindex_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_cgi.c Index: mod_cgi.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_cgi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_cgi.c 1999/07/16 08:28:40 1.3 +++ mod_cgi.c 1999/07/27 12:05:08 1.4 @@ -562,7 +562,6 @@ module MODULE_VAR_EXPORT cgi_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.8 +0 -1 apache-2.0/mpm/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_dir.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mod_dir.c 1999/07/24 18:39:02 1.7 +++ mod_dir.c 1999/07/27 12:05:08 1.8 @@ -224,7 +224,6 @@ module MODULE_VAR_EXPORT dir_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.3 +0 -1 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_echo.c 1999/07/24 20:54:36 1.2 +++ mod_echo.c 1999/07/27 12:05:08 1.3 @@ -63,7 +63,6 @@ API_VAR_EXPORT module echo_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_env.c Index: mod_env.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_env.c 1999/07/24 18:39:03 1.9 +++ mod_env.c 1999/07/27 12:05:08 1.10 @@ -256,7 +256,6 @@ module MODULE_VAR_EXPORT env_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_imap.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_imap.c 1999/07/24 18:39:03 1.8 +++ mod_imap.c 1999/07/27 12:05:08 1.9 @@ -897,7 +897,6 @@ module MODULE_VAR_EXPORT imap_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_include.c Index: mod_include.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_include.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_include.c 1999/07/16 08:28:42 1.3 +++ mod_include.c 1999/07/27 12:05:08 1.4 @@ -2467,7 +2467,6 @@ module MODULE_VAR_EXPORT includes_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_log_config.c 1999/07/24 18:39:03 1.8 +++ mod_log_config.c 1999/07/27 12:05:09 1.9 @@ -1113,7 +1113,6 @@ module MODULE_VAR_EXPORT config_log_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ init_config_log, /* open_logs */ 1.8 +0 -1 apache-2.0/mpm/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_mime.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mod_mime.c 1999/07/24 18:39:06 1.7 +++ mod_mime.c 1999/07/27 12:05:09 1.8 @@ -386,7 +386,6 @@ module MODULE_VAR_EXPORT mime_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ mime_post_config, /* post_config */ NULL, /* open_logs */ 1.9 +0 -1 apache-2.0/mpm/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_negotiation.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_negotiation.c 1999/07/24 18:39:06 1.8 +++ mod_negotiation.c 1999/07/27 12:05:09 1.9 @@ -2733,7 +2733,6 @@ module MODULE_VAR_EXPORT negotiation_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_setenvif.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_setenvif.c 1999/07/24 18:39:06 1.9 +++ mod_setenvif.c 1999/07/27 12:05:09 1.10 @@ -408,7 +408,6 @@ module MODULE_VAR_EXPORT setenvif_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_userdir.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_userdir.c 1999/07/24 18:39:08 1.9 +++ mod_userdir.c 1999/07/27 12:05:10 1.10 @@ -336,7 +336,6 @@ module userdir_module = { STANDARD20_MODULE_STUFF, - NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */