From a9b67465067d4dec868ae0ed669f80604dd20219 Mon Sep 17 00:00:00 2001 From: lilleman Date: Sun, 14 Jun 2015 11:30:02 +0200 Subject: [PATCH] Fixed bug that made session crash randomly --- lib/session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/session.js b/lib/session.js index ce06579..ade1b91 100644 --- a/lib/session.js +++ b/lib/session.js @@ -693,7 +693,7 @@ function session(sock) { returnObj.dataQueue = Buffer.concat([returnObj.dataQueue, data]); // Process queue - while (returnObj.dataQueue.length !== 0) { + while (returnObj.dataQueue.length > 4) { // Get this commands length cmdLength = parseInt(returnObj.dataQueue.readUInt32BE(0)); log.silly('larvitsmpp: lib/session.js: session() - sock.on(data) - Processing ' + cmdLength + ' bytes of data');