Skip to content

Commit 16116f5

Browse files
ronagjasnell
authored andcommitted
quic: remove noop code
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 <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent bfbdc84 commit 16116f5

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lib/internal/quic/core.js

+1-21
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,7 @@ class QuicStream extends Duplex {
25852585
highWaterMark,
25862586
defaultEncoding,
25872587
} = options;
2588+
25882589
super({
25892590
highWaterMark,
25902591
defaultEncoding,
@@ -2601,27 +2602,6 @@ class QuicStream extends Duplex {
26012602
this._readableState.readingMore = true;
26022603
this.on('pause', streamOnPause);
26032604

2604-
// See src/node_quic_stream.h for an explanation
2605-
// of the initial states for unidirectional streams.
2606-
if (this.unidirectional) {
2607-
if (session instanceof QuicServerSession) {
2608-
if (this.serverInitiated) {
2609-
// Close the readable side
2610-
this.push(null);
2611-
this.read();
2612-
} else {
2613-
// Close the writable side
2614-
this.end();
2615-
}
2616-
} else if (this.serverInitiated) {
2617-
// Close the writable side
2618-
this.end();
2619-
} else {
2620-
this.push(null);
2621-
this.read();
2622-
}
2623-
}
2624-
26252605
// The QuicStream writes are corked until kSetHandle
26262606
// is set, ensuring that writes are buffered in JavaScript
26272607
// until we have somewhere to send them.

0 commit comments

Comments
 (0)