You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/03/24 23:30:40 UTC
svn commit: r758065 - /httpd/httpd/trunk/server/main.c
Author: trawick
Date: Tue Mar 24 22:30:38 2009
New Revision: 758065
URL: http://svn.apache.org/viewvc?rev=758065&view=rev
Log:
set ap_server_conf as early as possible; axe the duplicate variable
Modified:
httpd/httpd/trunk/server/main.c
Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/main.c?rev=758065&r1=758064&r2=758065&view=diff
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Tue Mar 24 22:30:38 2009
@@ -471,7 +471,6 @@
const char *temp_error_log = NULL;
const char *error;
process_rec *process;
- server_rec *server_conf;
apr_pool_t *pglobal;
apr_pool_t *pconf;
apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
@@ -655,8 +654,8 @@
if (temp_error_log) {
ap_replace_stderr_log(process->pool, temp_error_log);
}
- server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
- if (!server_conf) {
+ ap_server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
+ if (!ap_server_conf) {
destroy_and_exit_process(process, 1);
}
@@ -666,21 +665,21 @@
destroy_and_exit_process(process, 1);
}
- rv = ap_process_config_tree(server_conf, ap_conftree,
+ rv = ap_process_config_tree(ap_server_conf, ap_conftree,
process->pconf, ptemp);
if (rv == OK) {
- ap_fixup_virtual_hosts(pconf, server_conf);
- ap_fini_vhost_config(pconf, server_conf);
+ ap_fixup_virtual_hosts(pconf, ap_server_conf);
+ ap_fini_vhost_config(pconf, ap_server_conf);
apr_hook_sort_all();
- if (ap_run_check_config(pconf, plog, ptemp, server_conf) != OK) {
+ if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
NULL, "Configuration check failed");
destroy_and_exit_process(process, 1);
}
if (configtestonly) {
- ap_run_test_config(pconf, server_conf);
+ ap_run_test_config(pconf, ap_server_conf);
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
destroy_and_exit_process(process, 0);
}
@@ -702,14 +701,13 @@
apr_pool_clear(plog);
- ap_server_conf = server_conf;
- if ( ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
+ if ( ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
0, NULL, "Unable to open logs");
destroy_and_exit_process(process, 1);
}
- if ( ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+ if ( ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
NULL, "Configuration Failed");
destroy_and_exit_process(process, 1);
@@ -734,8 +732,8 @@
apr_pool_create(&ptemp, pconf);
apr_pool_tag(ptemp, "ptemp");
ap_server_root = def_server_root;
- server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
- if (!server_conf) {
+ ap_server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
+ if (!ap_server_conf) {
destroy_and_exit_process(process, 1);
}
@@ -745,28 +743,28 @@
destroy_and_exit_process(process, 1);
}
- if (ap_process_config_tree(server_conf, ap_conftree, process->pconf,
+ if (ap_process_config_tree(ap_server_conf, ap_conftree, process->pconf,
ptemp) != OK) {
destroy_and_exit_process(process, 1);
}
- ap_fixup_virtual_hosts(pconf, server_conf);
- ap_fini_vhost_config(pconf, server_conf);
+ ap_fixup_virtual_hosts(pconf, ap_server_conf);
+ ap_fini_vhost_config(pconf, ap_server_conf);
apr_hook_sort_all();
- if (ap_run_check_config(pconf, plog, ptemp, server_conf) != OK) {
+ if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
NULL, "Configuration check failed");
destroy_and_exit_process(process, 1);
}
apr_pool_clear(plog);
- if (ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
+ if (ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
0, NULL, "Unable to open logs");
destroy_and_exit_process(process, 1);
}
- if (ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+ if (ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
0, NULL, "Configuration Failed");
destroy_and_exit_process(process, 1);
@@ -777,7 +775,7 @@
ap_run_optional_fn_retrieve();
- if (ap_mpm_run(pconf, plog, server_conf))
+ if (ap_mpm_run(pconf, plog, ap_server_conf))
break;
apr_pool_lock(pconf, 0);