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 MylesBorins committed Dec 17, 2019
1 parent ad5b715 commit 52aab47
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 @@ -2152,12 +2152,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 = ObjectCreate(null);
Expand Down

0 comments on commit 52aab47

Please sign in to comment.