summaryrefslogtreecommitdiff
path: root/lib/internal/http2
diff options
context:
space:
mode:
authorzero1five <zerodengyin@gmail.com>2019-06-02 19:39:03 +0800
committerRich Trott <rtrott@gmail.com>2019-06-25 14:46:17 -0700
commitf11a4ec638b2e159d6ed8840e2e6f1cc972f41a3 (patch)
tree74492d1308f4383236efe65cdea3d45d5bc22ffe /lib/internal/http2
parent33aef82b42ca689411673784e203e59d3f4eb142 (diff)
downloadandroid-node-v8-f11a4ec638b2e159d6ed8840e2e6f1cc972f41a3.tar.gz
android-node-v8-f11a4ec638b2e159d6ed8840e2e6f1cc972f41a3.tar.bz2
android-node-v8-f11a4ec638b2e159d6ed8840e2e6f1cc972f41a3.zip
http2: use writableFinished instead of _writableState
PR-URL: https://github.com/nodejs/node/pull/28007 Refs: https://github.com/nodejs/node/issues/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>
Diffstat (limited to 'lib/internal/http2')
-rw-r--r--lib/internal/http2/core.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index 8c05ff6267..63f9da5564 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -1556,7 +1556,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
@@ -1572,7 +1572,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
@@ -1982,8 +1982,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;