★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/d8942f877dNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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>
  • Loading branch information
zero1five authored and targos committed Jul 2, 2019
1 parent 1650bcf commit d8942f877d5c5c58312ac46d2e7374a96177dbad
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/internal/http2/core.js
@@ -1560,7 +1560,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) {
stream.setTimeout(0);
stream.removeAllListeners('timeout');

const { ending, finished } = stream._writableState;
const { ending } = stream._writableState;

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

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

// TODO(mcollina): remove usage of _*State properties
if (this._writableState.finished) {
if (this.writableFinished) {
if (!this.readable && this.closed) {
this.destroy();
return;

0 comments on commit d8942f8

Please sign in to comment.