mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-19 18:54:23 +03:00
Changes debuglogs schema to avoid unecessary str allocation
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "modsecurity/rules.h"
|
||||
#include "src/utils/string.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
|
||||
@@ -49,11 +50,9 @@ bool Allow::init(std::string *error) {
|
||||
|
||||
|
||||
bool Allow::evaluate(Rule *rule, Transaction *transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(4, "Dropping the evaluation of upcoming rules " \
|
||||
ms_dbg_a(transaction, 4, "Dropping the evaluation of upcoming rules " \
|
||||
"in favor of an `allow' action of type: " \
|
||||
+ allowTypeToName(m_allowType));
|
||||
#endif
|
||||
|
||||
transaction->m_allowType = m_allowType;
|
||||
|
||||
|
||||
@@ -30,9 +30,7 @@ namespace disruptive {
|
||||
|
||||
bool Deny::evaluate(Rule *rule, Transaction *transaction,
|
||||
std::shared_ptr<RuleMessage> rm) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(8, "Running action deny");
|
||||
#endif
|
||||
ms_dbg_a(transaction, 8, "Running action deny");
|
||||
|
||||
if (transaction->m_it.status == 200) {
|
||||
transaction->m_it.status = 403;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "modsecurity/actions/action.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rules.h"
|
||||
#include "modsecurity/rule_message.h"
|
||||
|
||||
#ifndef SRC_ACTIONS_DISRUPTIVE_DENY_H_
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "modsecurity/rules.h"
|
||||
#include "modsecurity/rule_message.h"
|
||||
|
||||
namespace modsecurity {
|
||||
@@ -33,9 +34,7 @@ bool Pass::evaluate(Rule *rule, Transaction *transaction,
|
||||
intervention::free(&transaction->m_it);
|
||||
intervention::reset(&transaction->m_it);
|
||||
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(8, "Running action pass");
|
||||
#endif
|
||||
ms_dbg_a(transaction, 8, "Running action pass");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user