Fixed bug that made session crash randomly

This commit is contained in:
2015-06-14 11:30:02 +02:00
parent 1cfe5f7850
commit a9b6746506
+1 -1
View File
@@ -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');