mqtt-packet
Advanced tools
Comparing version 7.0.0 to 7.1.0
{ | ||
"name": "mqtt-packet", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "Parse and generate MQTT packets like a breeze", | ||
@@ -5,0 +5,0 @@ "main": "mqtt.js", |
@@ -350,2 +350,4 @@ const bl = require('bl') | ||
if (packet.length <= 0) { return this._emitError(new Error('Malformed subscribe, no payload specified')) } | ||
while (this._pos < packet.length) { | ||
@@ -415,2 +417,4 @@ // Parse topic | ||
if (packet.length <= 0) { return this._emitError(new Error('Malformed suback, no payload specified')) } | ||
// Parse granted QoSes | ||
@@ -449,2 +453,4 @@ while (this._pos < this.packet.length) { | ||
if (packet.length <= 0) { return this._emitError(new Error('Malformed unsubscribe, no payload specified')) } | ||
while (this._pos < packet.length) { | ||
@@ -465,2 +471,9 @@ // Parse topic | ||
if (!this._parseMessageId()) return this._emitError(new Error('Cannot parse messageId')) | ||
if ((this.settings.protocolVersion === 3 || | ||
this.settings.protocolVersion === 4) && packet.length !== 2) { | ||
return this._emitError(new Error('Malformed unsuback, payload length must be 2')) | ||
} | ||
if (packet.length <= 0) { return this._emitError(new Error('Malformed unsuback, no payload specified')) } | ||
// Properties mqtt 5 | ||
@@ -474,2 +487,3 @@ if (this.settings.protocolVersion === 5) { | ||
packet.granted = [] | ||
while (this._pos < this.packet.length) { | ||
@@ -476,0 +490,0 @@ const code = this._list.readUInt8(this._pos++) |
Sorry, the diff of this file is too big to display
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
171626
5380