Keep the traffic stats more up-to-date (/msg *status traffic)

This now also adds the traffic caused by webadmin, schat and dcc bouncing
to the stats.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1183 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-08-31 07:21:21 +00:00
parent 5fa8d03d2b
commit 00fcf767a7
6 changed files with 35 additions and 12 deletions
+11
View File
@@ -15,6 +15,17 @@ const unsigned int CDCCBounce::m_uiMaxDCCBuffer = 10 * 1024;
// If less than this is in the buffer, the receiving side continues
const unsigned int CDCCBounce::m_uiMinDCCBuffer = 2 * 1024;
CDCCBounce::~CDCCBounce() {
if (m_pPeer) {
m_pPeer->Shutdown();
m_pPeer = NULL;
}
if (m_pUser) {
m_pUser->AddBytesRead(GetBytesRead());
m_pUser->AddBytesWritten(GetBytesWritten());
}
}
void CDCCBounce::ReadLine(const CString& sData) {
CString sLine = sData;
+1 -6
View File
@@ -47,12 +47,7 @@ public:
EnableReadLine();
}
}
virtual ~CDCCBounce() {
if (m_pPeer) {
m_pPeer->Shutdown();
m_pPeer = NULL;
}
}
virtual ~CDCCBounce();
static unsigned short DCCRequest(const CString& sNick, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, bool bIsChat, CUser* pUser, const CString& sLocalIP, const CString& sRemoteIP);
+11
View File
@@ -9,6 +9,17 @@
#include "DCCSock.h"
#include "User.h"
CDCCSock::~CDCCSock() {
if ((m_pFile) && (!m_bNoDelFile)) {
m_pFile->Close();
delete m_pFile;
}
if (m_pUser) {
m_pUser->AddBytesRead(GetBytesRead());
m_pUser->AddBytesWritten(GetBytesWritten());
}
}
void CDCCSock::ReadData(const char* data, int len) {
if (!m_pFile) {
DEBUG_ONLY(cout << "File not open! closing get." << endl);
+1 -6
View File
@@ -53,12 +53,7 @@ public:
m_bNoDelFile = false;
}
*/
virtual ~CDCCSock() {
if ((m_pFile) && (!m_bNoDelFile)) {
m_pFile->Close();
delete m_pFile;
}
}
virtual ~CDCCSock();
virtual void ReadData(const char* data, int len);
virtual void ConnectionRefused();
+8
View File
@@ -57,6 +57,8 @@ public:
EnableReadLine();
}
~CSChatSock();
virtual Csock *GetSockObj(const CS_STRING & sHostname, u_short iPort)
{
CSChatSock *p = new CSChatSock(sHostname, iPort);
@@ -457,6 +459,12 @@ private:
//////////////////// methods ////////////////
CSChatSock::~CSChatSock()
{
m_pModule->GetUser()->AddBytesRead(GetBytesRead());
m_pModule->GetUser()->AddBytesWritten(GetBytesWritten());
}
void CSChatSock::ReadLine(const CS_STRING & sLine)
{
if (m_pModule)
+3
View File
@@ -335,6 +335,9 @@ CWebAdminSock::~CWebAdminSock() {
CWebAdminAuth* pAuth = (CWebAdminAuth*) &(*m_spAuth);
pAuth->SetWebAdminSock(NULL);
}
CZNC::Get().AddBytesRead(GetBytesRead());
CZNC::Get().AddBytesWritten(GetBytesWritten());
}
bool CWebAdminSock::OnPageRequest(const CString& sURI, CString& sPageRet) {