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

coap

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coap - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

8

lib/agent.js

@@ -170,8 +170,6 @@ const bl = require('bl')

Agent.prototype._nextMessageId = function nextToken() {
var messageId = this._lastMessageId++
if (++this._lastMessageId === maxMessageId)
this._lastMessageId = 1
if (this._lastMessageId === maxMessageId)
this._lastMessageId = -1
return messageId;
return this._lastMessageId
}

@@ -178,0 +176,0 @@

{
"name": "coap",
"version": "0.4.1",
"version": "0.4.2",
"description": "A CoAP library for node modelled after 'http'",

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

@@ -50,2 +50,23 @@

it('should calculate the messageIds module 16 bytes', function(done) {
var total = 2
doReq()
agent._lastMessageId = Math.pow(2, 16) - 1
doReq()
server.on('message', function(msg, rsinfo) {
console.log(parse(msg))
if (total === 2) {
// nothing to do
} else if (total === 1) {
expect(parse(msg).messageId).to.eql(1)
done()
}
total--
})
})
it('should differentiate two requests with different tokens', function(done) {

@@ -52,0 +73,0 @@ var firstToken

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