Skip to content

Commit

Permalink
http2: use more descriptive names
Browse files Browse the repository at this point in the history
PR-URL: #17328
Fixes: #15303
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Sebastiaan Deckers <[email protected]>
  • Loading branch information
jasnell authored and MylesBorins committed Dec 12, 2017
1 parent 4994d57 commit 658338e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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().
Expand Down

0 comments on commit 658338e

Please sign in to comment.