Comparing version 0.20.0 to 0.21.0
@@ -38,9 +38,6 @@ /* | ||
TFramedTransport.receiver = function(callback, seqid) { | ||
var residual = []; | ||
var residual = new Buffer(0); | ||
return function(data) { | ||
// push received data to residual | ||
for(var i = 0; i < data.length; ++i) { | ||
residual.push(data[i]) | ||
} | ||
residual = Buffer.concat([residual, Buffer.from(data)]); | ||
@@ -52,4 +49,4 @@ while (residual.length > 0) { | ||
} | ||
// get single package sieze | ||
var frameSize = binary.readI32(Buffer.from(residual.slice(0, 4)), 0); | ||
// Get single package size | ||
var frameSize = binary.readI32(residual, 0); | ||
// Not enough bytes to continue, save and resume on next packet | ||
@@ -60,6 +57,6 @@ if (residual.length < 4 + frameSize) { | ||
// splice first 4 bytes | ||
residual.splice(0, 4) | ||
// get package data | ||
var frame = Buffer.from(residual.splice(0, frameSize)); | ||
// Get package data | ||
var frame = residual.subarray(4, 4 + frameSize); | ||
// Remove processed data from residual | ||
residual = residual.subarray(4 + frameSize); | ||
callback(new TFramedTransport(frame), seqid); | ||
@@ -66,0 +63,0 @@ } |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"author": { | ||
@@ -12,0 +12,0 @@ "name": "Apache Thrift Developers", |
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
233433
5876