Do not try to intercept a request after a failed rule. (See #53)

This commit is contained in:
brectanus
2007-05-10 04:28:37 +00:00
parent dfde8169e6
commit 2733cc739a
3 changed files with 12 additions and 4 deletions

View File

@@ -531,7 +531,7 @@ static int hook_request_early(request_rec *r) {
/* Process phase REQUEST_HEADERS */
rc = DECLINED;
if (modsecurity_process_phase(msr, PHASE_REQUEST_HEADERS)) {
if (modsecurity_process_phase(msr, PHASE_REQUEST_HEADERS) > 0) {
rc = perform_interception(msr);
}
@@ -649,7 +649,7 @@ static int hook_request_late(request_rec *r) {
record_time_checkpoint(msr, 1);
rc = DECLINED;
if (modsecurity_process_phase(msr, PHASE_REQUEST_BODY)) {
if (modsecurity_process_phase(msr, PHASE_REQUEST_BODY) > 0) {
rc = perform_interception(msr);
}

View File

@@ -639,7 +639,7 @@ apr_status_t msre_ruleset_process_phase(msre_ruleset *ruleset, modsec_rec *msr)
arr = ruleset->phase_logging;
break;
default :
/* ENH Log a warning message here. */
msr_log(msr, 1, "Internal Error: Invalid phase %d", msr->phase);
return -1;
}
@@ -777,8 +777,12 @@ apr_status_t msre_ruleset_process_phase(msre_ruleset *ruleset, modsec_rec *msr)
}
}
}
else if (rc < 0) {
msr_log(msr, 1, "Rule processing failed.");
return -1;
}
else {
msr_log(msr, 1, "Unknown rule processing return code: %i.", rc);
msr_log(msr, 1, "Rule processing failed with unknown return code: %i.", rc);
return -1;
}
}