mirror of
https://github.com/znc/znc.git
synced 2026-05-01 19:12:31 +02:00
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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user