* @param conftree The config tree to process
* @param p The pool for general allocation
* @param ptemp The pool for temporary allocations
+ * @return OK if no problems
*/
-AP_DECLARE(void) ap_process_config_tree(server_rec *s, ap_directive_t *conftree,
- apr_pool_t *p, apr_pool_t *ptemp);
+AP_DECLARE(int) ap_process_config_tree(server_rec *s,
+ ap_directive_t *conftree,
+ apr_pool_t *p,
+ apr_pool_t *ptemp);
/* Module-method dispatchers, also for http_request.c */
/**
ap_cfg_closefile(cfp);
}
-AP_DECLARE(void) ap_process_config_tree(server_rec *s,
- ap_directive_t *conftree,
- apr_pool_t *p, apr_pool_t *ptemp)
+AP_DECLARE(int) ap_process_config_tree(server_rec *s,
+ ap_directive_t *conftree,
+ apr_pool_t *p,
+ apr_pool_t *ptemp)
{
const char *errmsg;
cmd_parms parms;
parms.err_directive->filename);
ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0, p,
"%s", errmsg);
- exit(1);
+ return HTTP_INTERNAL_SERVER_ERROR;
}
+
+ return OK;
}
AP_CORE_DECLARE(int) ap_parse_htaccess(ap_conf_vector_t **result,
destroy_and_exit_process(process, 1);
}
- ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
- ap_fixup_virtual_hosts(pconf, server_conf);
- ap_fini_vhost_config(pconf, server_conf);
- apr_hook_sort_all();
- if (configtestonly) {
- ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
- destroy_and_exit_process(process, 0);
+ rv = ap_process_config_tree(server_conf, ap_conftree,
+ process->pconf, ptemp);
+ if (rv == OK) {
+ ap_fixup_virtual_hosts(pconf, server_conf);
+ ap_fini_vhost_config(pconf, server_conf);
+ apr_hook_sort_all();
+ if (configtestonly) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
+ destroy_and_exit_process(process, 0);
+ }
}
signal_server = APR_RETRIEVE_OPTIONAL_FN(ap_signal_server);
}
}
+ /* If our config failed, deal with that here. */
+ if (rv != OK) {
+ destroy_and_exit_process(process, 1);
+ }
+
apr_pool_clear(plog);
if ( ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
destroy_and_exit_process(process, 1);
}
- ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
+ if (ap_process_config_tree(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);
apr_hook_sort_all();