aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2018-05-31 10:39:19 +0200
committerAnatoli Papirovski <apapirovski@mac.com>2018-06-03 16:24:31 +0200
commit7b6c4283d26079bb6fd3d300d0ac952a087d8a7b (patch)
tree8b0eecabe0d2650cdd4a8198c6d8a3851b91a490 /lib
parentd52878137d16d5170c6910ff5a1210156df03160 (diff)
downloadandroid-node-v8-7b6c4283d26079bb6fd3d300d0ac952a087d8a7b.tar.gz
android-node-v8-7b6c4283d26079bb6fd3d300d0ac952a087d8a7b.tar.bz2
android-node-v8-7b6c4283d26079bb6fd3d300d0ac952a087d8a7b.zip
http2: fix premature destroy
Check stream._writableState.finished instead of stream.writable as the latter can lead to premature calls to destroy and dropped writes on busy processes. PR-URL: https://github.com/nodejs/node/pull/21051 Fixes: https://github.com/nodejs/node/issues/20750 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/http2/core.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index 97a6a5b4f1..bbbc3c2130 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -1896,7 +1896,7 @@ class Http2Stream extends Duplex {
}
// TODO(mcollina): remove usage of _*State properties
- if (!this.writable) {
+ if (this._writableState.finished) {
if (!this.readable && this.closed) {
this.destroy();
return;