Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mqtt-packet

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqtt-packet - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

3

constants.js

@@ -42,2 +42,5 @@ /* Protocol - protocol constants */

/* Connack */
module.exports.SESSIONPRESENT_MASK = 0x01;
/* Connect */

@@ -44,0 +47,0 @@ module.exports.USERNAME_MASK = 0x80;

3

generate.js

@@ -200,3 +200,4 @@

pos += writeLength(buffer, pos, 2);
pos += writeNumber(buffer, pos, rc);
buffer.writeUInt8(opts.sessionPresent && protocol.SESSIONPRESENT_MASK || 0, pos++);
buffer.writeUInt8(rc, pos++);

@@ -203,0 +204,0 @@ return buffer;

{
"name": "mqtt-packet",
"version": "3.1.1",
"version": "3.2.0",
"description": "Parse and generate MQTT packets like a breeze",

@@ -5,0 +5,0 @@ "main": "mqtt.js",

@@ -236,4 +236,4 @@

var packet = this.packet
packet.returnCode = this._parseNum()
packet.sessionPresent = !!(this._list.readUInt8(this._pos++) & constants.SESSIONPRESENT_MASK)
packet.returnCode = this._list.readUInt8(this._pos)
if(packet.returnCode === -1)

@@ -240,0 +240,0 @@ return this.emit('error', new Error('cannot parse return code'))

@@ -152,2 +152,3 @@ mqtt-packet   [![Build Status](https://travis-ci.org/mqttjs/mqtt-packet.png)](https://travis-ci.org/mqttjs/mqtt-packet)

, returnCode: 0 // or whatever else you see fit
, sessionPresent: false // or true.
}

@@ -154,0 +155,0 @@ ```

@@ -261,2 +261,3 @@

, length: 2
, sessionPresent: false
, returnCode: 0

@@ -267,2 +268,14 @@ }, new Buffer([

testParseGenerate('connack with return code 0 session present bit set', {
cmd: 'connack'
, retain: false
, qos: 0
, dup: false
, length: 2
, sessionPresent: true
, returnCode: 0
}, new Buffer([
32, 2, 1, 0
]))
testParseGenerate('connack with return code 5', {

@@ -274,2 +287,3 @@ cmd: 'connack'

, length: 2
, sessionPresent: false
, returnCode: 5

@@ -764,1 +778,5 @@ }, new Buffer([

})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc