Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
spdy sends too many closes, listen to only one
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed May 28, 2016
1 parent 12e15ef commit 0d53d93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Swarm (peerInfo) {
if (this.muxedConns[key]) {
const muxer = this.muxedConns[key].muxer
muxer.end()
muxer.on('close', () => {
muxer.once('close', () => {
delete this.muxedConns[key]
callback()
})
Expand Down
2 changes: 1 addition & 1 deletion test/09-swarm-with-muxing.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ describe('high level API - with everything mixed all together!', function () {
const ready = () => ++count === 3 ? done() : null

swarmB.once('peer-mux-closed', (peerInfo) => {
expect(Object.keys(swarmA.muxedConns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(0)
ready()
})

Expand Down

0 comments on commit 0d53d93

Please sign in to comment.