From d967b20b7838ca0544c6ddba5ff08363f3c97a0b Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 16 Dec 2016 13:41:28 +0100 Subject: [PATCH 1/2] chore: update deps --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b868f5d..b582b42 100644 --- a/package.json +++ b/package.json @@ -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": [ From 5cea51818bd0f820b22303281c8a78042fb47cc4 Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 16 Dec 2016 13:46:37 +0100 Subject: [PATCH 2/2] fix(end): destroy all streams before ending Otherwise we will wait for the other side to end --- src/muxer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/muxer.js b/src/muxer.js index 571746f..8c4542c 100644 --- a/src/muxer.js +++ b/src/muxer.js @@ -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) } }