Fixed bug in handling rejection of screen with name that's already
in use. The client was being correctly rejected but the already connected client was being forcefully disconnected too because the client to disconnect was found by looking up the client by name. We now instead look up the client by IClient*.
This commit is contained in:
parent
3db9facb6c
commit
bede6352c1
|
@ -1507,8 +1507,8 @@ bool
|
|||
CServer::removeClient(IClient* client)
|
||||
{
|
||||
// return false if not in list
|
||||
CClientList::iterator i = m_clients.find(getName(client));
|
||||
if (i == m_clients.end()) {
|
||||
CClientSet::iterator i = m_clientSet.find(client);
|
||||
if (i == m_clientSet.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1521,8 +1521,8 @@ CServer::removeClient(IClient* client)
|
|||
client->getEventTarget());
|
||||
|
||||
// remove from list
|
||||
m_clients.erase(i);
|
||||
m_clientSet.erase(client);
|
||||
m_clients.erase(getName(client));
|
||||
m_clientSet.erase(i);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue