diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2018-05-29 19:07:02 +0200 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-06-01 10:58:26 +0200 |
commit | 35858bb98e08c3c275a416712e158b5d32992c9a (patch) | |
tree | 76b6238224473b39cb41f76c3bf7fa23be3de9e9 /src/node_http2.h | |
parent | 87cd389bbfe69004c4792d4982908a350238a6da (diff) | |
download | android-node-v8-35858bb98e08c3c275a416712e158b5d32992c9a.tar.gz android-node-v8-35858bb98e08c3c275a416712e158b5d32992c9a.tar.bz2 android-node-v8-35858bb98e08c3c275a416712e158b5d32992c9a.zip |
http2: force through RST_STREAM in destroy
If still needed, force through RST_STREAM in Http2Stream#destroy
calls, so that nghttp2 can wrap up properly and doesn't continue
trying to read & write data to the stream.
PR-URL: https://github.com/nodejs/node/pull/21016
Fixes: https://github.com/nodejs/node/issues/21008
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r-- | src/node_http2.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/node_http2.h b/src/node_http2.h index 824084d0ba..e0a93c8f0f 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -9,6 +9,7 @@ #include "stream_base-inl.h" #include "string_bytes.h" +#include <algorithm> #include <queue> namespace node { @@ -803,6 +804,12 @@ class Http2Session : public AsyncWrap, public StreamListener { pending_rst_streams_.emplace_back(stream_id); } + inline bool HasPendingRstStream(int32_t stream_id) { + return pending_rst_streams_.end() != std::find(pending_rst_streams_.begin(), + pending_rst_streams_.end(), + stream_id); + } + // Handle reads/writes from the underlying network transport. void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override; void OnStreamAfterWrite(WriteWrap* w, int status) override; |