Compare commits

...

3 Commits

Author SHA1 Message Date
61c36f9e09 chore: release version v0.29.2 2020-10-23 15:40:54 +02:00
f82da56901 chore: update contributors 2020-10-23 15:40:53 +02:00
06f26e586f fix: cleanup open streams on conn close (#791) 2020-10-23 15:34:59 +02:00
3 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,13 @@
<a name="0.29.2"></a>
## [0.29.2](https://github.com/libp2p/js-libp2p/compare/v0.29.1...v0.29.2) (2020-10-23)
### Bug Fixes
* cleanup open streams on conn close ([#791](https://github.com/libp2p/js-libp2p/issues/791)) ([06f26e5](https://github.com/libp2p/js-libp2p/commit/06f26e5))
<a name="0.29.1"></a>
## [0.29.1](https://github.com/libp2p/js-libp2p/compare/v0.29.0...v0.29.1) (2020-10-22)

View File

@ -1,6 +1,6 @@
{
"name": "libp2p",
"version": "0.29.1",
"version": "0.29.2",
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
"main": "src/index.js",

View File

@ -306,7 +306,13 @@ class Upgrader {
},
newStream: newStream || errConnectionNotMultiplexed,
getStreams: () => muxer ? muxer.streams : errConnectionNotMultiplexed,
close: (err) => maConn.close(err)
close: async (err) => {
await maConn.close(err)
// Ensure remaining streams are aborted
if (muxer) {
muxer.streams.map(stream => stream.abort(err))
}
}
})
this.onConnection(connection)