gracenode
Advanced tools
Comparing version 3.11.0 to 3.11.1
@@ -45,6 +45,7 @@ 'use strict'; | ||
function create(payload, status, seq) { | ||
var plen = payload.length + SIZE_HEADSTOP_SIZE; | ||
var payloadLength = Buffer.byteLength(payload); | ||
var plen = payloadLength + SIZE_HEADSTOP_SIZE; | ||
var packet = _Buffer.alloc(plen); | ||
// payload length | ||
packet.writeUInt32BE(payload.length, OFFSET_PLEN); | ||
packet.writeUInt32BE(payloadLength, OFFSET_PLEN); | ||
// protocol version | ||
@@ -66,3 +67,3 @@ packet.writeUInt8(VERSION, OFFSET_VER); | ||
// add magic stop symbol at the end | ||
packet.writeUInt32BE(MSTOP, SIZE_HEADER_SIZE + payload.length); | ||
packet.writeUInt32BE(MSTOP, SIZE_HEADER_SIZE + payloadLength); | ||
return packet; | ||
@@ -69,0 +70,0 @@ } |
@@ -75,3 +75,4 @@ 'use strict'; | ||
var item = payloads[i]; | ||
buf.writeUInt32BE(item.payload.length, offset); | ||
var payloadLength = Buffer.byteLength(item.payload); | ||
buf.writeUInt32BE(payloadLength, offset); | ||
offset += 4; | ||
@@ -87,3 +88,3 @@ buf.writeUInt16BE(item.command, offset); | ||
} | ||
offset += item.payload.length; | ||
offset += payloadLength; | ||
} | ||
@@ -90,0 +91,0 @@ MSTOP.copy(buf, offset, 0); |
{ | ||
"name": "gracenode", | ||
"description": "A node.js framework for real-time applications over UDP and TCP protocols with extendable modules for quick and clean evelopment.", | ||
"version": "3.11.0", | ||
"version": "3.11.1", | ||
"author": "Nobuyori Takahashi <voltrue2@yahoo.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
2926647
367
21558
1
78
20