From 35858bb98e08c3c275a416712e158b5d32992c9a Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Tue, 29 May 2018 19:07:02 +0200 Subject: 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 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- src/node_http2.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/node_http2.h') 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 #include 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; -- cgit v1.2.3