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/trunk@2019 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-06-08 19:09:47 +00:00
parent 68c5ee5909
commit a8b011fd50

View File

@@ -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::<username>" 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++;
}
}