Merge pull request #1938 from ether/fix/unknown-connection-message

Drop messages from unknown connections
This commit is contained in:
Marcel Klehr 2013-10-12 11:24:51 -07:00
commit 64392542f9
1 changed files with 4 additions and 3 deletions

View File

@ -144,15 +144,16 @@ exports.handleDisconnect = function(client)
*/
exports.handleMessage = function(client, message)
{
if(message == null)
{
messageLogger.warn("Message is null!");
return;
}
if(!message.type)
{
messageLogger.warn("Message has no type attribute!");
return;
}
if(!sessioninfos[client.id]) {
messageLogger.warn("Dropped message from an unknown connection.")
return;
}