mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
let the client check if a connection is still established and for the correct peer address before processing data. Closes #1356
This commit is contained in:
parent
893964848e
commit
01527f51c9
|
@ -83,7 +83,8 @@ int CNetClient::Recv(CNetChunk *pChunk)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(m_Connection.Feed(&m_RecvUnpacker.m_Data, &Addr))
|
||||
if(m_Connection.State() != NET_CONNSTATE_OFFLINE && m_Connection.State() != NET_CONNSTATE_ERROR && net_addr_comp(m_Connection.PeerAddress(), &Addr) == 0
|
||||
&& m_Connection.Feed(&m_RecvUnpacker.m_Data, &Addr))
|
||||
m_RecvUnpacker.Start(&Addr, &m_Connection, 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue