mirror of
https://github.com/znc/znc.git
synced 2026-05-02 19:42:32 +02:00
Fix traffic accounting of WebModules
The traffic generated by it was just discarded. Now it's accounted towards a user if one is logged in, else towards the global traffic usage. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1825 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -117,6 +117,15 @@ CWebSock::~CWebSock() {
|
||||
pAuth->SetWebSock(NULL);
|
||||
}
|
||||
|
||||
CUser *pUser = GetSession()->GetUser();
|
||||
if (pUser) {
|
||||
pUser->AddBytesWritten(GetBytesWritten());
|
||||
pUser->AddBytesRead(GetBytesRead());
|
||||
} else {
|
||||
CZNC::Get().AddBytesWritten(GetBytesWritten());
|
||||
CZNC::Get().AddBytesRead(GetBytesRead());
|
||||
}
|
||||
|
||||
// If the module IsFake() then it was created as a dummy and needs to be deleted
|
||||
if (m_pModule && m_pModule->IsFake()) {
|
||||
m_pModule->UnlinkSocket(this);
|
||||
|
||||
Reference in New Issue
Block a user