Skip to content

Commit

Permalink
http2: remove unnecessary bind from setImmediate
Browse files Browse the repository at this point in the history
PR-URL: #28131
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
apapirovski authored and targos committed Jan 14, 2020
1 parent 91845d8 commit dce435d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2155,12 +2155,16 @@ class Http2Stream extends Duplex {
// By using setImmediate we allow pushStreams to make it through
// before the stream is officially closed. This prevents a bug
// in most browsers where those pushStreams would be rejected.
setImmediate(this.close.bind(this));
setImmediate(callStreamClose, this);
}
}
}
}

function callStreamClose(stream) {
stream.close();
}

function processHeaders(oldHeaders) {
assertIsObject(oldHeaders, 'headers');
const headers = Object.create(null);
Expand Down

0 comments on commit dce435d

Please sign in to comment.