Skip to content

Commit

Permalink
quic: remove noop code
Browse files Browse the repository at this point in the history
this.unidirectional depends on #id which is never set
in the constructor, hence this condition will never run
and can be removed.

PR-URL: #33914
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
  • Loading branch information
ronag authored and jasnell committed Jun 18, 2020
1 parent bfbdc84 commit 16116f5
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions lib/internal/quic/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,7 @@ class QuicStream extends Duplex {
highWaterMark,
defaultEncoding,
} = options;

super({
highWaterMark,
defaultEncoding,
Expand All @@ -2601,27 +2602,6 @@ class QuicStream extends Duplex {
this._readableState.readingMore = true;
this.on('pause', streamOnPause);

// See src/node_quic_stream.h for an explanation
// of the initial states for unidirectional streams.
if (this.unidirectional) {
if (session instanceof QuicServerSession) {
if (this.serverInitiated) {
// Close the readable side
this.push(null);
this.read();
} else {
// Close the writable side
this.end();
}
} else if (this.serverInitiated) {
// Close the writable side
this.end();
} else {
this.push(null);
this.read();
}
}

// The QuicStream writes are corked until kSetHandle
// is set, ensuring that writes are buffered in JavaScript
// until we have somewhere to send them.
Expand Down

0 comments on commit 16116f5

Please sign in to comment.