mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
http2: use more descriptive names
PR-URL: https://github.com/nodejs/node/pull/17328 Fixes: https://github.com/nodejs/node/issues/15303 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
This commit is contained in:
1 parent
4994d57890
commit
658338e317
1 file changed
+15
-15
+15
-15
@@ -582,15 +582,15 @@ function doShutdown(options) {
|
||||
function submitShutdown(options) {
|
||||
const type = this[kType];
|
||||
debug(`Http2Session ${sessionName(type)}: submitting shutdown request`);
|
||||
const fn = doShutdown.bind(this, options);
|
||||
const shutdownFn = doShutdown.bind(this, options);
|
||||
if (type === NGHTTP2_SESSION_SERVER && options.graceful === true) {
|
||||
// first send a shutdown notice
|
||||
this[kHandle].shutdownNotice();
|
||||
// then, on flip of the event loop, do the actual shutdown
|
||||
setImmediate(fn);
|
||||
setImmediate(shutdownFn);
|
||||
return;
|
||||
}
|
||||
fn();
|
||||
shutdownFn();
|
||||
}
|
||||
|
||||
function finishSessionDestroy(socket) {
|
||||
@@ -877,12 +877,12 @@ class Http2Session extends EventEmitter {
|
||||
debug(`Http2Session ${sessionName(this[kType])}: sending settings`);
|
||||
|
||||
state.pendingAck++;
|
||||
const fn = submitSettings.bind(this, settings);
|
||||
const settingsFn = submitSettings.bind(this, settings);
|
||||
if (state.connecting) {
|
||||
this.once('connect', fn);
|
||||
this.once('connect', settingsFn);
|
||||
return;
|
||||
}
|
||||
fn();
|
||||
settingsFn();
|
||||
}
|
||||
|
||||
// Destroy the Http2Session
|
||||
@@ -968,14 +968,14 @@ class Http2Session extends EventEmitter {
|
||||
this.on('shutdown', callback);
|
||||
}
|
||||
|
||||
const fn = submitShutdown.bind(this, options);
|
||||
const shutdownFn = submitShutdown.bind(this, options);
|
||||
if (state.connecting) {
|
||||
this.once('connect', fn);
|
||||
this.once('connect', shutdownFn);
|
||||
return;
|
||||
}
|
||||
|
||||
debug(`Http2Session ${sessionName(type)}: sending shutdown`);
|
||||
fn();
|
||||
shutdownFn();
|
||||
}
|
||||
|
||||
_onTimeout() {
|
||||
@@ -1379,12 +1379,12 @@ class Http2Stream extends Duplex {
|
||||
if (code < 0 || code > kMaxInt)
|
||||
throw new errors.RangeError('ERR_OUT_OF_RANGE', 'code');
|
||||
|
||||
const fn = submitRstStream.bind(this, code);
|
||||
const rstStreamFn = submitRstStream.bind(this, code);
|
||||
if (this[kID] === undefined) {
|
||||
this.once('ready', fn);
|
||||
this.once('ready', rstStreamFn);
|
||||
return;
|
||||
}
|
||||
fn();
|
||||
rstStreamFn();
|
||||
}
|
||||
|
||||
rstWithNoError() {
|
||||
@@ -1415,12 +1415,12 @@ class Http2Stream extends Duplex {
|
||||
options = Object.assign({}, options);
|
||||
validatePriorityOptions(options);
|
||||
|
||||
const fn = submitPriority.bind(this, options);
|
||||
const priorityFn = submitPriority.bind(this, options);
|
||||
if (this[kID] === undefined) {
|
||||
this.once('ready', fn);
|
||||
this.once('ready', priorityFn);
|
||||
return;
|
||||
}
|
||||
fn();
|
||||
priorityFn();
|
||||
}
|
||||
|
||||
// Called by this.destroy().
|
||||
|
||||
Reference in new issue
Block a user