bhyde 99/10/13 13:28:04
Modified: src/include http_main.h src/main http_main.c Log: Remove all but one WIN32 from http_main. Other minor changes. Revision Changes Path 1.4 +1 -2 apache-2.0/src/include/http_main.h Index: http_main.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_main.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_main.h 1999/08/31 05:32:19 1.3 +++ http_main.h 1999/10/13 20:27:42 1.4 @@ -62,8 +62,7 @@ extern "C" { #endif -extern MODULE_VAR_EXPORT char *ap_server_argv0; - +extern MODULE_VAR_EXPORT const char *ap_server_argv0; extern API_VAR_EXPORT const char *ap_server_root; /* for -C, -c and -D switches */ 1.17 +11 -24 apache-2.0/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- http_main.c 1999/10/11 22:07:23 1.16 +++ http_main.c 1999/10/13 20:27:55 1.17 @@ -62,7 +62,7 @@ #include "util_uri.h" #include "ap_mpm.h" -char *ap_server_argv0; +const char *ap_server_argv0; API_VAR_EXPORT const char *ap_server_root; @@ -201,8 +201,6 @@ exit(process_exit_value); } -#define PATHSEPARATOR '/' /* Belongs in some apr os include file */ - static process_rec *create_process(int argc, const char **argv) { process_rec *process; @@ -217,11 +215,7 @@ ap_create_context(&process->pconf, process->pool); process->argc = argc; process->argv = argv; - { - char *s = strrchr(argv[0], PATHSEPARATOR); - - process->short_name = s ? ++s : argv[0]; - } + process->short_name = ap_filename_of_pathname(argv[0]); return process; } @@ -285,19 +279,12 @@ server_rec *server_conf; ap_context_t *pglobal = process->pool; ap_context_t *pconf = process->pconf; - ap_context_t *plog; /* Pool for error-logging files */ - ap_context_t *ptemp; /* Pool for temporary config stuff */ - ap_context_t *pcommands; /* Pool for -C and -c switches */ - -#ifndef WIN32 - if ((ap_server_argv0 = strrchr(argv[0], '/')) != NULL) -#else - if ((ap_server_argv0 = strrchr(argv[0], '\\')) != NULL) -#endif - ++ap_server_argv0; - else - ap_server_argv0 = argv[0]; + ap_context_t *plog; /* Pool of log streams, reset _after_ each read of conf */ + ap_context_t *ptemp; /* Pool for temporary config stuff, reset often */ + ap_context_t *pcommands; /* Pool for -C and -c switches */ + ap_server_argv0 = process->short_name; + ap_util_uri_init(); g_pHookPool=pglobal; @@ -352,18 +339,18 @@ ap_create_context(&plog, pglobal); ap_create_context(&ptemp, pconf); - /* for legacy reasons, we read the configuration twice before - we actually serve any requests */ + /* Note that we preflight the config file once + before reading it _again_ in the main loop. + This allows things, log files configuration + for example, to settle down. */ ap_server_root = def_server_root; ap_run_pre_config(pconf, plog, ptemp); server_conf = ap_read_config(process, ptemp, confname); - if (configtestonly) { fprintf(stderr, "Syntax OK\n"); destroy_and_exit_process(process, 0); } - ap_clear_pool(plog); ap_run_open_logs(pconf, plog, ptemp, server_conf); ap_post_config_hook(pconf, plog, ptemp, server_conf);