Skip to content

Commit

Permalink
Remove invalid assert
Browse files Browse the repository at this point in the history
Fixes molnarg#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
  • Loading branch information
thughes committed Mar 7, 2017
1 parent 2c4c310 commit 47650b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/protocol/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 47650b9

Please sign in to comment.