Skip to content

Commit

Permalink
Server|Fixed: Catch exception when receiving invalid packet from shel…
Browse files Browse the repository at this point in the history
…l user
  • Loading branch information
skyjake committed Feb 1, 2013
1 parent db12b81 commit 3601488
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions doomsday/server/src/shelluser.cpp
Expand Up @@ -86,14 +86,21 @@ void ShellUser::handleIncomingPackets()
QScopedPointer<Packet> packet(nextPacket());
if(packet.isNull()) break;

switch(protocol().recognize(packet.data()))
try
{
case shell::Protocol::Command:
Con_Execute(CMDS_CONSOLE, protocol().command(*packet).toUtf8().constData(), false, true);
break;
switch(protocol().recognize(packet.data()))
{
case shell::Protocol::Command:
Con_Execute(CMDS_CONSOLE, protocol().command(*packet).toUtf8().constData(), false, true);
break;

default:
break;
default:
break;
}
}
catch(Error const &er)
{
LOG_WARNING("Error while processing packet from %s:\n%s") << packet->from() << er.asText();
}
}
}

0 comments on commit 3601488

Please sign in to comment.