From cbe133dce05c28eec01629246817858129191b99 Mon Sep 17 00:00:00 2001 From: oy Date: Thu, 2 Jul 2015 22:13:44 +0200 Subject: [PATCH] let the client check if a connection is still established and for the correct peer address before processing data. Closes #1356 --- src/engine/shared/network_client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/shared/network_client.cpp b/src/engine/shared/network_client.cpp index 013b7a538..6118ba489 100644 --- a/src/engine/shared/network_client.cpp +++ b/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); } }