Handles better the memory utilization

- Added reference counts to Rule and AuditLog;
- Some memory leaks were removed, including GeoLookup;
- Deal better with parser errors;
- Overriding the AutlogLogWritter destructor.
This commit is contained in:
Felipe Zimmerle
2015-07-26 22:40:51 -03:00
parent 0e7c13e3c0
commit e016b72a8e
31 changed files with 385 additions and 169 deletions

View File

@@ -42,7 +42,8 @@ class DebugLog : public std::ofstream {
*/
DebugLog()
: m_is_configured(false),
m_debug_level(0) { }
m_debug_level(0),
m_referenceCount(0) { }
bool setOutputFile(const std::string& file);
virtual bool write_log(int level, const std::string& data);
@@ -53,6 +54,9 @@ class DebugLog : public std::ofstream {
virtual DebugLog *new_instance();
void refCountDecreaseAndCheck(void);
void refCountIncrease(void);
private:
/*
ModSecurityDebugLog(ModSecurityDebugLog const&);
@@ -60,6 +64,7 @@ class DebugLog : public std::ofstream {
*/
int m_debug_level;
bool m_is_configured;
int m_referenceCount;
};
} // namespace ModSecurity