From d561e29ff52e7d9020d3387bbe0592094cafafaf Mon Sep 17 00:00:00 2001 From: Tametomo Date: Sat, 16 May 2009 01:39:34 -0600 Subject: Force client to exit on detecting a zero length packet. The current networking code will get stuck in an infinite loop currently if it tries to handle these, and the packet id isn't helpful in identifying what packet it is. Since this specific case creates a rabbit, and will flood logger with unhandled messages until the hard drive is completely filled, it's a lot more friendly to force a client exit on detection than to continue. Signed-off-by: Tametomo --- src/net/ea/network.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 7ddc0bc2..b3e0032a 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -223,6 +223,9 @@ void Network::dispatchMessages() MessageHandlerIterator iter = mMessageHandlers.find(msg.getId()); + if (msg.getLength() == 0) + logger->error("Zero length packet received. Exiting."); + if (iter != mMessageHandlers.end()) { iter->second->handleMessage(msg); -- cgit v1.2.3-70-g09d2