From a495d8204be1fa08751d136fdabc3ae8d2528829 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 2 Jul 2010 19:55:50 +0000 Subject: [PATCH] Import r2019 GetAnonConnectionCount(): Bugfix The function counted almost all sockets, but it's only supposed to count inbound ones which aren't identified client sockets. Do this by adding a check for "socket is really inbound" in there. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/branches/0.090_fixes@2050 726aef4b-f618-498e-8847-2d620e286838 --- Socket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Socket.cpp b/Socket.cpp index 866e4a58..2dc48d1e 100644 --- a/Socket.cpp +++ b/Socket.cpp @@ -18,7 +18,8 @@ unsigned int CSockManager::GetAnonConnectionCount(const CString &sIP) const { for (it = begin(); it != end(); ++it) { CZNCSock *pSock = *it; // Logged in CClients have "USR::" as their sockname - if (pSock->GetRemoteIP() == sIP && pSock->GetSockName().Left(5) != "USR::") { + if (pSock->GetType() == Csock::INBOUND && pSock->GetRemoteIP() == sIP + && pSock->GetSockName().Left(5) != "USR::") { ret++; } }