engine.io-parser
Advanced tools
Comparing version 1.0.7 to 1.0.8
1.0.8 / 2014-07-16 | ||
================== | ||
* adjust protocol revision | ||
* handle invalid utf8 errors gracefully | ||
* fix memory leak on browser | ||
1.0.7 / 2014-06-24 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -24,3 +24,3 @@ /** | ||
exports.protocol = 2; | ||
exports.protocol = 3; | ||
@@ -197,3 +197,7 @@ /** | ||
data = utf8.decode(data); | ||
try { | ||
data = utf8.decode(data); | ||
} catch (e) { | ||
return err; | ||
} | ||
var type = data.charAt(0); | ||
@@ -513,2 +517,3 @@ | ||
var numberTooLong = false; | ||
while (bufferTail.byteLength > 0) { | ||
@@ -518,6 +523,16 @@ var tailArray = new Uint8Array(bufferTail); | ||
var msgLength = ''; | ||
for (var i = 1; ; i++) { | ||
if (tailArray[i] == 255) break; | ||
if (msgLength.length > 310) { | ||
numberTooLong = true; | ||
break; | ||
} | ||
msgLength += tailArray[i]; | ||
} | ||
if(numberTooLong) return callback(err, 0, 1); | ||
bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length); | ||
@@ -539,2 +554,3 @@ msgLength = parseInt(msgLength); | ||
} | ||
buffers.push(msg); | ||
@@ -541,0 +557,0 @@ bufferTail = sliceBuffer(bufferTail, msgLength); |
@@ -150,3 +150,7 @@ /** | ||
var type = data.charAt(0); | ||
data = utf8.decode(data); | ||
try { | ||
data = utf8.decode(data); | ||
} catch (e) { | ||
return err; | ||
} | ||
@@ -153,0 +157,0 @@ if (Number(type) != type || !packetslist[type]) { |
{ | ||
"name": "engine.io-parser", | ||
"description": "Parser for the client for the realtime Engine", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"homepage": "https://github.com/LearnBoost/engine.io-protocol", | ||
@@ -6,0 +6,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29274
860