summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-05-16 01:39:34 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 21:00:45 +0100
commitd561e29ff52e7d9020d3387bbe0592094cafafaf (patch)
treea8815a3e7c0dfb0e3fc182da0194767565f9ae5f /src
parentd2205a452c37af39fd8f76be33863ff057658d03 (diff)
downloadmana-d561e29ff52e7d9020d3387bbe0592094cafafaf.tar.gz
mana-d561e29ff52e7d9020d3387bbe0592094cafafaf.tar.bz2
mana-d561e29ff52e7d9020d3387bbe0592094cafafaf.tar.xz
mana-d561e29ff52e7d9020d3387bbe0592094cafafaf.zip
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 <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/network.cpp3
1 files changed, 3 insertions, 0 deletions
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);