mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
This removes all of znc's c-ares code and instead enables Csocket's built-in version. That code is newer than ZNC's, but should hopefully work just as good. Let's wait for the bug reports.... git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1704 726aef4b-f618-498e-8847-2d620e286838
27 lines
714 B
C++
27 lines
714 B
C++
/*
|
|
* 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::<username>" as their sockname
|
|
if (pSock->GetRemoteIP() == sIP && pSock->GetSockName().Left(5) != "USR::") {
|
|
ret++;
|
|
}
|
|
}
|
|
|
|
DEBUG("There are [" << ret << "] clients from [" << sIP << "]");
|
|
|
|
return ret;
|
|
}
|