mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Merge in code fixes to create msr context on request failure.
This commit is contained in:
parent
4d03b029f1
commit
8b9d914ed0
@ -697,12 +697,20 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s
|
||||
msr = retrieve_tx_context(r);
|
||||
|
||||
/* Create a context for 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);
|
||||
}
|
||||
}
|
||||
if ((msr == NULL)
|
||||
&& ((level & APLOG_LEVELMASK) < APLOG_DEBUG)
|
||||
&& apr_table_get(r->subprocess_env, "UNIQUE_ID"))
|
||||
{
|
||||
msr = create_tx_context((request_rec *)r);
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
if (msr == NULL) {
|
||||
msr_log(msr, 9, "Failed to create context after request failure.");
|
||||
}
|
||||
else {
|
||||
msr_log(msr, 9, "Context created after request failure.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (msr == NULL) return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user