Drop messages from unknown connections

fixes #1908
pull/1938/head
Marcel Klehr 2013-10-12 18:51:04 +02:00
parent c3a96b34bb
commit aa77a615da
1 changed files with 4 additions and 3 deletions

View File

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