summaryrefslogtreecommitdiff
path: root/src/node_http2.h
diff options
context:
space:
mode:
authorDenys Otrishko <shishugi@gmail.com>2019-11-18 21:44:21 +0200
committerAnna Henningsen <anna@addaleax.net>2019-11-28 00:48:28 +0100
commit9590f577b03f621faf35f60e439b87431d293dee (patch)
treec013d6e832c7d4beccd2d86ebe3f94150f0135f5 /src/node_http2.h
parentdf0f9e47ee96c85c94610a7f1071c97843f5ef9f (diff)
downloadandroid-node-v8-9590f577b03f621faf35f60e439b87431d293dee.tar.gz
android-node-v8-9590f577b03f621faf35f60e439b87431d293dee.tar.bz2
android-node-v8-9590f577b03f621faf35f60e439b87431d293dee.zip
http2: allow to configure maximum tolerated invalid frames
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 61092b60c0..79d648276f 100644
--- a/src/node_http2.h
+++ b/src/node_http2.h
@@ -677,6 +677,7 @@ typedef struct {
uint8_t bitfield;
uint8_t priority_listener_count;
uint8_t frame_error_listener_count;
+ uint32_t max_invalid_frames = 1000;
} SessionJSFields;
// Indices for js_fields_, which serves as a way to communicate data with JS
@@ -689,6 +690,7 @@ enum SessionUint8Fields {
offsetof(SessionJSFields, priority_listener_count),
kSessionFrameErrorListenerCount =
offsetof(SessionJSFields, frame_error_listener_count),
+ kSessionMaxInvalidFrames = offsetof(SessionJSFields, max_invalid_frames),
kSessionUint8FieldCount = sizeof(SessionJSFields)
};
@@ -1024,7 +1026,7 @@ class Http2Session : public AsyncWrap, public StreamListener {
// accepted again.
int32_t rejected_stream_count_ = 0;
// Also use the invalid frame count as a measure for rejecting input frames.
- int32_t invalid_frame_count_ = 0;
+ uint32_t invalid_frame_count_ = 0;
void PushOutgoingBuffer(nghttp2_stream_write&& write);
void CopyDataIntoOutgoing(const uint8_t* src, size_t src_length);