http2: detect streams abandoned by nghttp2 · nodejs/node@1477f70 · GitHub
Skip to content

Commit 1477f70

Browse files
committed
http2: detect streams abandoned by nghttp2
When a peer sends GOAWAY(NO_ERROR), the session starts a graceful close on its own, which disarmed the detection of nghttp2 internally terminating the session after a protocol error. Instead, also treat it as an internal termination when nghttp2 no longer wants to read or write while we still have open streams. Signed-off-by: Matteo Collina <hello@matteocollina.com>
1 parent df2ea49 commit 1477f70

3 files changed

Lines changed: 134 additions & 3 deletions

File tree

‎src/node_http2.cc‎

Lines changed: 17 additions & 3 deletions

‎src/node_http2.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ class Http2Session : public AsyncWrap,
794794
BaseObjectPtr<Http2Ping> PopPing();
795795
bool AddPing(const uint8_t* data, v8::Local<v8::Function> callback);
796796
bool HasPendingData() const;
797+
bool HasStreamsAbandonedByNghttp2() const;
797798

798799
BaseObjectPtr<Http2Settings> PopSettings();
799800
bool AddSettings(v8::Local<v8::Function> callback);
Lines changed: 116 additions & 0 deletions

0 commit comments

Comments
 (0)