/* * Copyright (C) 2004-2010 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. */ #include "Socket.h" unsigned int CSockManager::GetAnonConnectionCount(const CString &sIP) const { const_iterator it; unsigned int ret = 0; 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::") { ret++; } } DEBUG("There are [" << ret << "] clients from [" << sIP << "]"); return ret; }