node-nailgun-client
Advanced tools
Comparing version 0.1.0 to 0.1.2
@@ -90,16 +90,20 @@ 'use strict'; | ||
function getChunksFromBuffer(bufferData) { | ||
if (buf.length < CHUNK_HEADER_LEN) { return []; } | ||
function getChunksFromBuffer() { | ||
var chunks = []; | ||
var size = buf.readUInt32BE(0); | ||
var end = CHUNK_HEADER_LEN + size; | ||
while (true) { | ||
if (buf.length < CHUNK_HEADER_LEN) { return chunks; } | ||
if (end > buf.length) { return []; } | ||
var size = buf.readUInt32BE(0); | ||
var end = CHUNK_HEADER_LEN + size; | ||
var chunk = {}; | ||
chunk.type = String.fromCharCode(buf.readUInt8(4)); | ||
chunk.data = buf.slice(CHUNK_HEADER_LEN, end); | ||
if (end > buf.length) { return chunks; } | ||
buf = buf.slice(end); | ||
return [chunk].concat(getChunksFromBuffer()); | ||
var chunk = {}; | ||
chunk.type = String.fromCharCode(buf.readUInt8(4)); | ||
chunk.data = buf.slice(CHUNK_HEADER_LEN, end); | ||
buf = buf.slice(end); | ||
chunks.push(chunk); | ||
} | ||
}; | ||
@@ -106,0 +110,0 @@ |
{ | ||
"name": "node-nailgun-client", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "A Node.js Nailgun client API and CLI", | ||
@@ -5,0 +5,0 @@ "author": "Markus Hedvall <mackanhedvall@gmail.com>", |
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
18010
173