Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Otrishko <shishugi@gmail.com>2019-11-18 23:12:15 +0300
committerAnna Henningsen <anna@addaleax.net>2019-11-30 05:57:20 +0300
commit7d37bcebea61fecdf13c1cdbf7dc8803f04cf6a9 (patch)
treea32fe6964b07e340d8a73b07fc075464d03f3a6e /src/node_http2.h
parent5ecfd947e2a1b363cdcb2bb7df730a5e0af3813d (diff)
http2: make maximum tolerated rejected streams configurable
PR-URL: https://github.com/nodejs/node/pull/30534 Fixes: https://github.com/nodejs/node/issues/30505 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r--src/node_http2.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_http2.h b/src/node_http2.h
index 79d648276fe..e828999f2b7 100644
--- a/src/node_http2.h
+++ b/src/node_http2.h
@@ -678,6 +678,7 @@ typedef struct {
uint8_t priority_listener_count;
uint8_t frame_error_listener_count;
uint32_t max_invalid_frames = 1000;
+ uint32_t max_rejected_streams = 100;
} SessionJSFields;
// Indices for js_fields_, which serves as a way to communicate data with JS
@@ -691,6 +692,7 @@ enum SessionUint8Fields {
kSessionFrameErrorListenerCount =
offsetof(SessionJSFields, frame_error_listener_count),
kSessionMaxInvalidFrames = offsetof(SessionJSFields, max_invalid_frames),
+ kSessionMaxRejectedStreams = offsetof(SessionJSFields, max_rejected_streams),
kSessionUint8FieldCount = sizeof(SessionJSFields)
};
@@ -1024,7 +1026,7 @@ class Http2Session : public AsyncWrap, public StreamListener {
// limit will result in the session being destroyed, as an indication of a
// misbehaving peer. This counter is reset once new streams are being
// accepted again.
- int32_t rejected_stream_count_ = 0;
+ uint32_t rejected_stream_count_ = 0;
// Also use the invalid frame count as a measure for rejecting input frames.
uint32_t invalid_frame_count_ = 0;