Refactoring on Action - having RuleWithAction and RuleWithActionsProperties

This commit is contained in:
Felipe Zimmerle
2020-09-23 13:48:15 -03:00
committed by Felipe Zimmerle
parent 1f80055f63
commit 5b204642ab
44 changed files with 2172 additions and 1533 deletions

View File

@@ -288,8 +288,18 @@ bool AuditLog::saveIfRelevant(Transaction *transaction) const noexcept {
return false;
}
// FIXME: This could be pre-computed. No need to compute in run time.
bool isThereSomethingToBeSaved = false;
for (RuleMessage *i : transaction->messageGetAll()) {
if (i->toBeAuditLog()) {
isThereSomethingToBeSaved = true;
break;
}
}
if ((m_status == RelevantOnlyAuditLogStatus
&& isRelevant(transaction->m_httpCodeReturned) == false)) {
&& isRelevant(transaction->m_httpCodeReturned) == false)
&& isThereSomethingToBeSaved == false) {
ms_dbg_a(transaction, 9, "Return code `" +
std::to_string(transaction->m_httpCodeReturned) + "'" \
" is not interesting to audit logs, relevant code(s): `" +