Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #47 from libp2p/fix/end
Browse files Browse the repository at this point in the history
fix(end): destroy all streams before ending
  • Loading branch information
daviddias authored Dec 18, 2016
2 parents 3f16c5f + 5cea518 commit 85d94d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@
"node": ">=4.0.0"
},
"devDependencies": {
"aegir": "^9.2.1",
"aegir": "^9.3.0",
"chai": "^3.5.0",
"gulp": "^3.9.1",
"interface-stream-muxer": "^0.5.0",
"libp2p-tcp": "^0.9.1",
"libp2p-websockets": "^0.9.0",
"multiaddr": "^2.0.3",
"pre-commit": "^1.2.0",
"libp2p-websockets": "^0.9.1",
"multiaddr": "^2.1.1",
"pre-commit": "^1.2.2",
"pull-file": "^1.0.0",
"pull-pair": "^1.1.0",
"pull-stream": "^3.5.0",
"run-parallel": "^1.1.6",
"tap-spec": "^4.1.1",
"tape": "^4.6.2"
"tape": "^4.6.3"
},
"dependencies": {
"browserify-zlib": "github:ipfs/browserify-zlib",
"interface-connection": "^0.3.0",
"lodash.noop": "^3.0.1",
"pull-stream-to-stream": "^1.3.3",
"spdy-transport": "^2.0.17",
"spdy-transport": "^2.0.18",
"stream-to-pull-stream": "^1.7.2"
},
"contributors": [
Expand Down
6 changes: 5 additions & 1 deletion src/muxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ module.exports = class Muxer extends EventEmitter {
path: '/',
headers: {}
}, (err, stream) => {
if (err) {
return callback(err)
}
conn.setInnerConn(toPull.duplex(stream), this.conn)
callback(err, conn)
callback(null, conn)
})

return conn
}

end (cb) {
this.spdy.destroyStreams()
this.spdy.end(cb)
}
}

0 comments on commit 85d94d4

Please sign in to comment.