Socket
Socket
Sign inDemoInstall

libp2p-tcp

Package Overview
Dependencies
29
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.14.4 to 0.14.5

.nyc_output/0b36235d-b5d7-48e8-bbbc-3de0d189943f.json

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.14.5"></a>
## [0.14.5](https://github.com/libp2p/js-libp2p-tcp/compare/v0.14.4...v0.14.5) (2020-04-28)
### Bug Fixes
* catch error from maConn.close ([#128](https://github.com/libp2p/js-libp2p-tcp/issues/128)) ([0fe0815](https://github.com/libp2p/js-libp2p-tcp/commit/0fe0815))
<a name="0.14.4"></a>

@@ -2,0 +12,0 @@ ## [0.14.4](https://github.com/libp2p/js-libp2p-tcp/compare/v0.14.3...v0.14.4) (2020-02-24)

2

package.json
{
"name": "libp2p-tcp",
"version": "0.14.4",
"version": "0.14.5",
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",

@@ -5,0 +5,0 @@ "leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",

@@ -16,2 +16,15 @@ 'use strict'

/**
* Attempts to close the given maConn. If a failure occurs, it will be logged.
* @private
* @param {MultiaddrConnection} maConn
*/
async function attemptClose (maConn) {
try {
maConn && await maConn.close()
} catch (err) {
log.error('an error occurred closing the connection', err)
}
}
module.exports = ({ handler, upgrader }, options) => {

@@ -32,3 +45,3 @@ const listener = new EventEmitter()

log.error('inbound connection failed', err)
return maConn && maConn.close()
return attemptClose(maConn)
}

@@ -56,3 +69,3 @@

return new Promise((resolve, reject) => {
server.__connections.forEach(maConn => maConn.close())
server.__connections.forEach(maConn => attemptClose(maConn))
server.close(err => err ? reject(err) : resolve())

@@ -59,0 +72,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc