From 4825bb6d8e412add5a5a421e9007270963f49fd9 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 18 Feb 2010 17:07:50 +0000 Subject: [PATCH] Revert r1765 This breaks traffic stats. Thanks to flakes for noticing. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1773 726aef4b-f618-498e-8847-2d620e286838 --- Modules.cpp | 2 ++ Modules.h | 3 +++ Socket.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules.cpp b/Modules.cpp index 9dc3731e..212b8774 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -105,6 +105,7 @@ const CString& CTimer::GetDescription() const { return m_sDescription; } CModule::CModule(ModHandle pDLL, CUser* pUser, const CString& sModName, const CString& sDataDir) { m_bFake = false; + m_bGlobal = false; m_pDLL = pDLL; m_pManager = &(CZNC::Get().GetManager());; m_pUser = pUser; @@ -698,6 +699,7 @@ bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CUser* p } pModule->SetDescription(sDesc); + pModule->SetGlobal(bIsGlobal); pModule->SetArgs(sArgs); push_back(pModule); diff --git a/Modules.h b/Modules.h index 2e29124f..fa61b166 100644 --- a/Modules.h +++ b/Modules.h @@ -678,12 +678,14 @@ public: // Setters void SetFake(bool b) { m_bFake = b; } + void SetGlobal(bool b) { m_bGlobal = b; } void SetDescription(const CString& s) { m_sDescription = s; } void SetArgs(const CString& s) { m_sArgs = s; } // !Setters // Getters bool IsFake() const { return m_bFake; } + bool IsGlobal() const { return m_bGlobal; } const CString& GetDescription() const { return m_sDescription; } const CString& GetArgs() const { return m_sArgs; } @@ -702,6 +704,7 @@ public: protected: bool m_bFake; + bool m_bGlobal; CString m_sDescription; set m_sTimers; set m_sSockets; diff --git a/Socket.cpp b/Socket.cpp index 973c6ed1..1d6661a5 100644 --- a/Socket.cpp +++ b/Socket.cpp @@ -50,7 +50,7 @@ CSocket::~CSocket() { m_pModule->UnlinkSocket(this); - if (pUser) { + if (!m_pModule->IsGlobal() && pUser) { pUser->AddBytesWritten(GetBytesWritten()); pUser->AddBytesRead(GetBytesRead()); } else {