From 5cea51818bd0f820b22303281c8a78042fb47cc4 Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 16 Dec 2016 13:46:37 +0100 Subject: [PATCH] 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) } }