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

Commit 0d53d93

Browse files
committed
spdy sends too many closes, listen to only one
1 parent 12e15ef commit 0d53d93

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function Swarm (peerInfo) {
108108
if (this.muxedConns[key]) {
109109
const muxer = this.muxedConns[key].muxer
110110
muxer.end()
111-
muxer.on('close', () => {
111+
muxer.once('close', () => {
112112
delete this.muxedConns[key]
113113
callback()
114114
})

test/09-swarm-with-muxing.node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('high level API - with everything mixed all together!', function () {
218218
const ready = () => ++count === 3 ? done() : null
219219

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

0 commit comments

Comments
 (0)