Permalink
Browse files

let the client check if a connection is still established and for the…

… correct peer address before processing data. Closes #1356
  • Loading branch information...
1 parent 46f8f04 commit 20578089f0bee3d9e544c1a0cd5699118c6b32d6 @oy oy committed Jul 2, 2015
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/engine/shared/network_client.cpp
@@ -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);
}
}

0 comments on commit 2057808

Please sign in to comment.