Only calculate debug data when we are debugging.

This commit is contained in:
brectanus 2007-05-16 19:48:21 +00:00
parent b60f206976
commit e03ea11f9a
2 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,8 @@
?? ??? 2007 - 2.2.0-trunk ?? ??? 2007 - 2.2.0-trunk
------------------------- -------------------------
* Only calculate debugging vars when we are debugging (more to come).
* Removed strnlen() calls for non-GNU platforms. * Removed strnlen() calls for non-GNU platforms.
11 May 2007 - 2.2.0-dev1 11 May 2007 - 2.2.0-dev1

View File

@ -110,14 +110,17 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
capture = apr_table_get(rule->actionset->actions, "capture") ? 1 : 0; capture = apr_table_get(rule->actionset->actions, "capture") ? 1 : 0;
/* Warn when the regex captures but "capture" is not set */ /* Warn when the regex captures but "capture" is not set */
if (msr->txcfg->debuglog_level >= 3) { if (msr->txcfg->debuglog_level >= 4) {
int capcount = 0; int capcount = 0;
rc = msc_fullinfo(regex, PCRE_INFO_CAPTURECOUNT, &capcount); rc = msc_fullinfo(regex, PCRE_INFO_CAPTURECOUNT, &capcount);
if ((capture == 0) && (capcount > 0)) { if ((capture == 0) && (capcount > 0)) {
msr_log(msr, 4, "Ignoring regex captures since \"capture\" action is not enabled."); msr_log(msr, 4, "Ignoring regex captures since \"capture\" action is not enabled.");
} }
if ((capture == 1) && (capcount == 0)) { if ((capture == 1) && (capcount == 0)) {
msr_log(msr, 3, "Notice. The \"capture\" action is enabled, but the regex does not have explicit captures."); msr_log(msr, 5, "The \"capture\" action is enabled, but the regex does not have explicit captures.");
}
if ((capture == 0) && (capcount > 0)) {
msr_log(msr, 6, "The \"capture\" action is not enabled, but the regex contains captures.");
} }
} }