Skip to content

Commit f11a4ec

Browse files
zero1fiveTrott
authored andcommitted
http2: use writableFinished instead of _writableState
PR-URL: #28007 Refs: #445 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 33aef82 commit f11a4ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/internal/http2/core.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) {
15561556
stream.setTimeout(0);
15571557
stream.removeAllListeners('timeout');
15581558

1559-
const { ending, finished } = stream._writableState;
1559+
const { ending } = stream._writableState;
15601560

15611561
if (!ending) {
15621562
// If the writable side of the Http2Stream is still open, emit the
@@ -1572,7 +1572,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) {
15721572

15731573
if (rstStreamStatus !== kNoRstStream) {
15741574
const finishFn = finishCloseStream.bind(stream, code);
1575-
if (!ending || finished || code !== NGHTTP2_NO_ERROR ||
1575+
if (!ending || stream.writableFinished || code !== NGHTTP2_NO_ERROR ||
15761576
rstStreamStatus === kForceRstStream)
15771577
finishFn();
15781578
else
@@ -1982,8 +1982,7 @@ class Http2Stream extends Duplex {
19821982
return;
19831983
}
19841984

1985-
// TODO(mcollina): remove usage of _*State properties
1986-
if (this._writableState.finished) {
1985+
if (this.writableFinished) {
19871986
if (!this.readable && this.closed) {
19881987
this.destroy();
19891988
return;

0 commit comments

Comments
 (0)