Skip to content

Commit db5e551

Browse files
committed
Make isRelevant() to const (cppcheck warnings in audit.log code)
1 parent 1083a7d commit db5e551

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

headers/modsecurity/audit_log.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class AuditLog {
172172

173173
bool saveIfRelevant(Transaction *transaction);
174174
bool saveIfRelevant(Transaction *transaction, int parts);
175+
bool isRelevant(const int status) const;
175176
bool isRelevant(int status);
176177

177178
static int addParts(int parts, std::string_view new_parts);

src/audit_log/audit_log.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ bool AuditLog::init(std::string *error) {
248248
}
249249

250250

251-
bool AuditLog::isRelevant(int status) {
251+
bool AuditLog::isRelevant(const int status) const {
252252
std::string sstatus = std::to_string(status);
253253

254254
if (m_relevant.empty()) {
@@ -264,6 +264,10 @@ bool AuditLog::isRelevant(int status) {
264264
Utils::Regex(m_relevant)) != 0;
265265
}
266266

267+
bool AuditLog::isRelevant(int status) {
268+
return static_cast<const AuditLog&>(*this).isRelevant(status);
269+
}
270+
267271

268272
bool AuditLog::saveIfRelevant(Transaction *transaction) {
269273
return saveIfRelevant(transaction, -1);

0 commit comments

Comments
 (0)