Skip to content

Commit

Permalink
http2: remove unnecessary event handlers
Browse files Browse the repository at this point in the history
PR-URL: #17328
Fixes: #15303
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
  • Loading branch information
jasnell authored and MylesBorins committed Dec 19, 2017
1 parent 927a281 commit 9fd0b32
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,6 @@ function onStreamDrain() {
response.emit('drain');
}

// TODO Http2Stream does not emit 'close'
function onStreamClosedRequest() {
const request = this[kRequest];
if (request !== undefined)
request.push(null);
}

// TODO Http2Stream does not emit 'close'
function onStreamClosedResponse() {
const response = this[kResponse];
if (response !== undefined)
response.emit('finish');
}

function onStreamAbortedRequest() {
const request = this[kRequest];
if (request !== undefined && request[kState].closed === false) {
Expand Down Expand Up @@ -247,7 +233,6 @@ class Http2ServerRequest extends Readable {
stream.on('trailers', onStreamTrailers);
stream.on('end', onStreamEnd);
stream.on('error', onStreamError);
stream.on('close', onStreamClosedRequest);
stream.on('aborted', onStreamAbortedRequest);
const onfinish = this[kFinish].bind(this);
stream.on('close', onfinish);
Expand Down Expand Up @@ -380,7 +365,6 @@ class Http2ServerResponse extends Stream {
stream[kResponse] = this;
this.writable = true;
stream.on('drain', onStreamDrain);
stream.on('close', onStreamClosedResponse);
stream.on('aborted', onStreamAbortedResponse);
const onfinish = this[kFinish].bind(this);
stream.on('close', onfinish);
Expand Down

0 comments on commit 9fd0b32

Please sign in to comment.