Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
http2: simplify on ready a bit
  • Loading branch information
jasnell committed Nov 22, 2017
commit d22b61c7def12121a9d0a9a4a5e41ae1014f19b6
9 changes: 1 addition & 8 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,13 +1172,6 @@ function streamOnSessionConnect() {
process.nextTick(emit, this, 'connect');
}

function streamOnceReady() {
const session = this[kSession];
debug(`Http2Stream ${this[kID]} [Http2Session ` +
`${sessionName(session[kType])}]: is ready`);
this.uncork();
}

function abort(stream) {
if (!stream[kState].aborted &&
!(stream._writableState.ended || stream._writableState.ending)) {
Expand Down Expand Up @@ -1208,7 +1201,6 @@ class Http2Stream extends Duplex {
writeQueueSize: 0
};

this.once('ready', streamOnceReady);
this.once('streamClosed', onStreamClosed);
this.once('finish', onHandleFinish);
this.on('resume', streamOnResume);
Expand All @@ -1229,6 +1221,7 @@ class Http2Stream extends Duplex {
handle.ontrailers = onStreamTrailers;
handle.onstreamclose = onStreamClose;
handle.onread = onStreamRead;
this.uncork();
this.emit('ready');
}

Expand Down