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 */