mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38: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
cc2dcd865a
commit
cbe133dce0
|
@ -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