Comparing version 1.6.4 to 1.6.5
# History | ||
## 1.6.5 | ||
* fix fullpacketparser error emission in case of partial packet | ||
## 1.6.4 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "protodef", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "A simple yet powerful way to define binary protocols", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -75,16 +75,14 @@ const Transform = require("readable-stream").Transform; | ||
_transform(chunk, enc, cb) { | ||
let packet; | ||
try { | ||
const packet = this.parsePacketBuffer(chunk); | ||
packet = this.parsePacketBuffer(chunk); | ||
if(packet.metadata.size!==chunk.length) | ||
throw new Error("Chunk size is",chunk.length,"but only",packet.metadata.size,"was read ; partial packet :", | ||
packet.data+"; buffer :",chunk.toString("hex")); | ||
else { | ||
this.push(packet); | ||
cb(); | ||
} | ||
console.log("Chunk size is "+chunk.length+" but only "+packet.metadata.size+" was read ; partial packet : "+ | ||
packet.data+"; buffer :"+chunk.toString("hex")); | ||
} | ||
catch(e) { | ||
cb(e); | ||
return cb(e); | ||
} | ||
this.push(packet); | ||
cb(); | ||
} | ||
@@ -91,0 +89,0 @@ } |
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
58850
29
1539