Replace CIRCNetwork::FindClient() with FindClients()

FindClient() is not enough, because there are no restrictions to used
identifiers. They don't necessarily need to be unique, and the same
identified client might re-connect meanwhile a ghost connection is
still hanging there.
This commit is contained in:
J-P Nurmi
2014-11-12 10:22:45 +01:00
parent 24a72d9a32
commit d308d727f7
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -669,14 +669,15 @@ const CString& CIRCNetwork::GetName() const {
return m_sName;
}
CClient* CIRCNetwork::FindClient(const CString& sIdentifier) const {
std::vector<CClient*> CIRCNetwork::FindClients(const CString& sIdentifier) const {
std::vector<CClient*> vClients;
for (CClient* pClient : m_vClients) {
if (pClient->GetIdentifier().Equals(sIdentifier)) {
return pClient;
vClients.push_back(pClient);
}
}
return NULL;
return vClients;
}
void CIRCNetwork::SetUser(CUser *pUser) {