+14
-0
@@ -317,2 +317,7 @@ /* | ||
| req.sender.on('timeout', function (err) { | ||
| req.emit('timeout', err) | ||
| that.abort(req) | ||
| }) | ||
| req.sender.on('sent', function() { | ||
@@ -337,2 +342,11 @@ that._msgInFlight-- | ||
| Agent.prototype.abort = function (req) { | ||
| req.sender.removeAllListeners() | ||
| req.sender.reset() | ||
| this._cleanUp() | ||
| delete this._msgIdToReq[req._packet.messageId] | ||
| delete this._tkToReq[req._packet.token.readUInt32BE(0)] | ||
| } | ||
| function urlPropertyToPacketOption(url, req, property, option, separator) { | ||
@@ -339,0 +353,0 @@ if (url[property]) |
@@ -64,2 +64,3 @@ /* | ||
| that.emit('error', err) | ||
| that.emit('timeout', err) | ||
| }, parameters.exchangeLifetime * 1000) | ||
@@ -66,0 +67,0 @@ } |
+1
-1
| { | ||
| "name": "coap", | ||
| "version": "0.10.3", | ||
| "version": "0.10.4", | ||
| "description": "A CoAP library for node modelled after 'http'", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+14
-0
@@ -617,2 +617,16 @@ /* | ||
| it('should timeout after ~247 seconds', function(done) { | ||
| var req = doReq() | ||
| req.on('error', function() {}) | ||
| req.on('timeout', function(err) { | ||
| expect(err).to.have.property('message', 'No reply in 247s') | ||
| expect(err).to.have.property('retransmitTimeout', 247) | ||
| done() | ||
| }) | ||
| fastForward(1000, 247 * 1000) | ||
| }) | ||
| it('should retry four times before erroring', function(done) { | ||
@@ -619,0 +633,0 @@ var req = doReq() |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
146908
0.49%4078
0.54%