From 22ec30773990ba0e5359c73f34f94bd7a2f091b3 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 12 Feb 2020 08:56:03 -0300 Subject: [PATCH] Fix 7495675d540b3b3ccce681773205a4fe34daeb64 --- headers/modsecurity/rules_set.h | 2 +- src/rules.cc | 45 --------------------------------- src/transaction.cc | 4 --- 3 files changed, 1 insertion(+), 50 deletions(-) diff --git a/headers/modsecurity/rules_set.h b/headers/modsecurity/rules_set.h index c08b9368..ae08cc0f 100644 --- a/headers/modsecurity/rules_set.h +++ b/headers/modsecurity/rules_set.h @@ -46,7 +46,7 @@ class RulesSet : public RulesProperties { public: RulesSet() : RulesProperties(new DebugLog()), - unicode_codepage(0), + unicode_codepage(0) #ifndef NO_LOGS ,m_secmarker_skipped(0) #endif diff --git a/src/rules.cc b/src/rules.cc index c277279b..b36b12de 100644 --- a/src/rules.cc +++ b/src/rules.cc @@ -31,51 +31,6 @@ using modsecurity::Utils::HttpsClient; namespace modsecurity { -/** - * @name incrementReferenceCount - * @brief Increment the number of transactions using this class - * @ingroup ModSecCore - * - * At certain point it is expected to have two differnt - * groups of rules attached to a specific core, this happens - * for instance when a webserver is reloading its - * configurations, the old configurations/rules is available - * for the old connections and the new rules are available - * for the newest connections. - * - * @return Number of the current transactions using this rules - * - */ -void RulesSet::incrementReferenceCount(void) { - this->m_referenceCount++; -} - - -/** - * @name decrementReferenceCount - * @brief Decrement the number of transactions using this class - * @ingroup ModSecCore - * - * @return Number of the current transactions using this rules - * - */ -void RulesSet::decrementReferenceCount(void) { - this->m_referenceCount--; - if (this->m_referenceCount == 0) { - /** - * FIXME: If there are new rules loaded (new instance - * of this class) and the reference is zero, we - * can delete this instance freeing some memory. - * - */ - /* - * std::cout << "We may want to delete this rules instance" \ - * << std::endl; - */ - } -} - - /** * @name loadFromUri * @brief load rules from a give uri diff --git a/src/transaction.cc b/src/transaction.cc index 44a8bbd4..19c60070 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -164,7 +164,6 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData) TransactionAnchoredVariables(this) { m_id = std::to_string(this->m_timeStamp) + \ std::to_string(modsecurity::utils::generate_transaction_unique_id()); - m_rules->incrementReferenceCount(); m_variableUrlEncodedError.set("0", 0); @@ -236,7 +235,6 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCb m_variableTimeYear(""), m_logCbData(logCbData), TransactionAnchoredVariables(this) { - m_rules->incrementReferenceCount(); m_variableUrlEncodedError.set("0", 0); @@ -255,8 +253,6 @@ Transaction::~Transaction() { m_rulesMessages.clear(); - m_rules->decrementReferenceCount(); - intervention::free(&m_it); intervention::clean(&m_it);