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');