New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-mbed-dtls

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mbed-dtls - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 1.3.3
* Fix send callback handling to prevent deadlock
# 1.3.2

@@ -2,0 +6,0 @@

2

package.json
{
"name": "node-mbed-dtls",
"version": "1.3.2",
"version": "1.3.3",
"description": "Node mbed DTLS",

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

@@ -49,24 +49,24 @@ 'use strict';

_sendEncrypted(msg) {
// make absolutely sure the socket will let us send
if (!this.dgramSocket || !this.dgramSocket._handle) {
if (this._sendCallback) {
this._sendCallback(new Error('no underlying socket'));
this._sendCallback = null;
// store the callback here because '_write' might be called
// again before the underlying socket finishes sending
const sendCb = this._sendCallback;
this._sendCallback = null;
const sendFinished = (err) => {
if (sendCb) {
sendCb(err);
}
if (this._clientEnd) {
process.nextTick(() => {
this._finishEnd();
});
this._finishEnd();
}
};
// make absolutely sure the socket will let us send
if (!this.dgramSocket || !this.dgramSocket._handle) {
process.nextTick(() => {
sendFinished(new Error('no underlying socket'));
});
return;
}
this.dgramSocket.send(msg, 0, msg.length, this.remotePort, this.remoteAddress, err => {
if (this._sendCallback) {
this._sendCallback(err);
this._sendCallback = null;
}
if (this._clientEnd) {
this._finishEnd();
}
});
this.dgramSocket.send(msg, 0, msg.length, this.remotePort, this.remoteAddress, sendFinished);
}

@@ -86,3 +86,8 @@

this._hadError = true;
this.emit('error', code, msg);
if (this._sendCallback) {
this._sendCallback(code);
this._sendCallback = null;
} else {
this.emit('error', code, msg);
}
this._end();

@@ -89,0 +94,0 @@ }

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