From 47650b96a4720cf7bd520dc6ab275e594c961a8a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 7 Mar 2017 11:13:09 -0800 Subject: [PATCH] Remove invalid assert Fixes #228 In the case where this._push(frame) returns null (i.e., the frame is too large for the window and split or the window size is <=0), moreNeeded will be set to null. Then this._queue.push(frame) is called, but moreNeeded is still null. Thus, any time the window is <=0 or the frame is split we'll hit the assert: var moreNeeded = null; if (this._queue.length === 0) { moreNeeded = this._push(frame); } if (moreNeeded === null) { this._queue.push(frame); } return moreNeeded; Credit goes to @jrabek for original version of this patch --- lib/protocol/connection.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/protocol/connection.js b/lib/protocol/connection.js index 2b86b7f..264934f 100644 --- a/lib/protocol/connection.js +++ b/lib/protocol/connection.js @@ -323,8 +323,7 @@ priority_loop: var moreNeeded = this.push(frame); this._changeStreamCount(frame.count_change); - assert(moreNeeded !== null); // The frame shouldn't be unforwarded - if (moreNeeded === false) { + if (!moreNeeded) { break priority_loop; } }