Changes with Apache 2.0.29-dev
+ *) Change open_logs hook to return a value, allowing you
+ to flag a error while opening logs
+ [Ian Holsman, Doug MacEachern]
*) Change post_config hook to return a value, allowing you
to flag a error post config
* @param plog The logging streams pool
* @param ptemp The temporary pool
* @param s The list of server_recs
- * @return OK or a
+ * @return OK or DECLINED on success anything else is a error
*/
AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec *s))
* @param plog The logging streams pool
* @param ptemp The temporary pool
* @param s The list of server_recs
+ * @return OK or DECLINED on success anything else is a error
*/
-AP_DECLARE_HOOK(void,open_logs,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec *s))
+AP_DECLARE_HOOK(int,open_logs,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec *s))
/**
* Run the child_init functions for each module
* server will still call any remaining modules with an handler for this
* phase.
*/
-static void x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
+static int x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{
/*
* Log the call and exit.
*/
trace_add(s, NULL, NULL, "x_open_logs()");
+ return OK;
}
/*
}
#endif
-static void init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, server_rec *s)
+static int init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, server_rec *s)
{
/* First, do "physical" server, which gets default log fd and format
* for the virtual servers, if they don't override...
for (s = s->next; s; s = s->next) {
open_multi_logs(s, p);
}
+ return OK;
}
static void init_child(apr_pool_t *p, server_rec *s)
}
*/
-AP_IMPLEMENT_HOOK_VOID(open_logs,
+AP_IMPLEMENT_HOOK_RUN_ALL(int, open_logs,
(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp,
- server_rec *s),(pconf,plog,ptemp,s))
+ server_rec *s),(pconf,plog,ptemp,s),OK,DECLINED)
AP_IMPLEMENT_HOOK_VOID(child_init,
(apr_pool_t *pchild, server_rec *s),(pchild,s))
return OK;
}
-static void core_open_logs(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
+static int core_open_logs(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
ap_open_logs(s, pconf);
+ return OK;
}
static void core_insert_filter(request_rec *r)
destroy_and_exit_process(process, 0);
}
apr_pool_clear(plog);
- ap_run_open_logs(pconf, plog, ptemp, server_conf);
+ if ( ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Unable to open logs\n");
+ destroy_and_exit_process(process, 1);
+ }
if ( ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Configuration Failed\n");
destroy_and_exit_process(process, 1);
ap_fini_vhost_config(pconf, server_conf);
apr_sort_hooks();
apr_pool_clear(plog);
- ap_run_open_logs(pconf, plog, ptemp, server_conf);
+ if ( ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Unable to open logs\n");
+ destroy_and_exit_process(process, 1);
+ }
+
if (ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR | APLOG_NOERRNO, 0, NULL, "Configuration Failed\n");
destroy_and_exit_process(process, 1);