molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

Remove invalid assert #236

Open thughes opened 7 years ago

thughes commented 7 years ago

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

hthetiot commented 6 years ago

merged https://github.com/kaazing/node-http2/commit/f367de6d7dd7085fd0a377958f4390371da50048