From e251a9bd578a9427dd2d1c44fa2ce0f454ade1f3 Mon Sep 17 00:00:00 2001 From: brectanus Date: Thu, 19 Jul 2007 13:33:46 +0000 Subject: [PATCH] Add back code to send an alert on request failure. --- apache2/mod_security2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apache2/mod_security2.c b/apache2/mod_security2.c index a179cda0..5c855ff9 100644 --- a/apache2/mod_security2.c +++ b/apache2/mod_security2.c @@ -695,6 +695,16 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s if (r == NULL) return; msr = retrieve_tx_context(r); + + /* Alert for failed requests we never had the chance to process */ + /* TODO: This needs more testing */ + if (level & APLOG_ERR) { + if (msr == NULL && apr_table_get(r->subprocess_env, "UNIQUE_ID")) { + msr = create_tx_context((request_rec *)r); + msr_log(msr, 1, "Request failed before processing could begin"); + } + } + if (msr == NULL) return; /* Store the error message for later */