File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2202,11 +2202,18 @@ void Http2Stream::SubmitRstStream(const uint32_t code) {
2202
2202
// the pending data when it is safe to do so. This is to avoid
2203
2203
// double free error due to unwanted behavior of nghttp2.
2204
2204
// Ref:https://github.com/nodejs/node/issues/38964
2205
- if (!is_writable () && is_reading ()) {
2205
+
2206
+ // Add stream to the pending list if it is received with scope
2207
+ // below in the stack. The pending list may not get processed
2208
+ // if RST_STREAM received is not in scope and added to the list
2209
+ // causing endpoint to hang.
2210
+ if (session_->is_in_scope () &&
2211
+ !is_writable () && is_reading ()) {
2206
2212
session_->AddPendingRstStream (id_);
2207
2213
return ;
2208
2214
}
2209
2215
2216
+
2210
2217
// If possible, force a purge of any currently pending data here to make sure
2211
2218
// it is sent before closing the stream. If it returns non-zero then we need
2212
2219
// to wait until the current write finishes and try again to avoid nghttp2
You can’t perform that action at this time.
0 commit comments