Skip to content

Commit d8942f8

Browse files
zero1fivetargos
authored andcommitted
http2: use writableFinished instead of _writableState
PR-URL: #28007 Refs: #445 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 1650bcf commit d8942f8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/internal/http2/core.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) {
15601560
stream.setTimeout(0);
15611561
stream.removeAllListeners('timeout');
15621562

1563-
const { ending, finished } = stream._writableState;
1563+
const { ending } = stream._writableState;
15641564

15651565
if (!ending) {
15661566
// If the writable side of the Http2Stream is still open, emit the
@@ -1576,7 +1576,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) {
15761576

15771577
if (rstStreamStatus !== kNoRstStream) {
15781578
const finishFn = finishCloseStream.bind(stream, code);
1579-
if (!ending || finished || code !== NGHTTP2_NO_ERROR ||
1579+
if (!ending || stream.writableFinished || code !== NGHTTP2_NO_ERROR ||
15801580
rstStreamStatus === kForceRstStream)
15811581
finishFn();
15821582
else
@@ -1986,8 +1986,7 @@ class Http2Stream extends Duplex {
19861986
return;
19871987
}
19881988

1989-
// TODO(mcollina): remove usage of _*State properties
1990-
if (this._writableState.finished) {
1989+
if (this.writableFinished) {
19911990
if (!this.readable && this.closed) {
19921991
this.destroy();
19931992
return;

0 commit comments

Comments
 (0)