Fix multiple connections from the same IP [Issue 2]

pull/3/head
iamsi 5 years ago
parent 2af187297d
commit da1a38a88b

@ -77,6 +77,7 @@ bool CClient::operator ==(const CClient &client) const
{ {
return ((client.m_Callsign == m_Callsign) && return ((client.m_Callsign == m_Callsign) &&
(client.m_Ip == m_Ip) && (client.m_Ip == m_Ip) &&
(client.m_Ip.GetPort() == m_Ip.GetPort()) &&
(client.m_ReflectorModule == m_ReflectorModule)); (client.m_ReflectorModule == m_ReflectorModule));
} }

@ -122,7 +122,8 @@ std::shared_ptr<CClient> CClients::FindClient(const CIp &Ip)
// find client // find client
for ( auto it=begin(); it!=end(); it++ ) for ( auto it=begin(); it!=end(); it++ )
{ {
if ( (*it)->GetIp() == Ip ) // check the port too to allow multiple clients from the same ip
if ( ((*it)->GetIp() == Ip) && ((*it)->GetIp().GetPort() == Ip.GetPort()) )
{ {
return *it; return *it;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.