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.cc
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.cc')
-rw-r--r--src/node_http2.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_http2.cc b/src/node_http2.cc
index 459cc3b0e60..17a8a859d91 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -920,7 +920,8 @@ int Http2Session::OnBeginHeadersCallback(nghttp2_session* handle,
if (UNLIKELY(!session->CanAddStream() ||
Http2Stream::New(session, id, frame->headers.cat) ==
nullptr)) {
- if (session->rejected_stream_count_++ > 100)
+ if (session->rejected_stream_count_++ >
+ session->js_fields_.max_rejected_streams)
return NGHTTP2_ERR_CALLBACK_FAILURE;
// Too many concurrent streams being opened
nghttp2_submit_rst_stream(**session, NGHTTP2_FLAG_NONE, id,
@@ -3062,6 +3063,7 @@ void Initialize(Local<Object> target,
NODE_DEFINE_CONSTANT(target, kSessionPriorityListenerCount);
NODE_DEFINE_CONSTANT(target, kSessionFrameErrorListenerCount);
NODE_DEFINE_CONSTANT(target, kSessionMaxInvalidFrames);
+ NODE_DEFINE_CONSTANT(target, kSessionMaxRejectedStreams);
NODE_DEFINE_CONSTANT(target, kSessionUint8FieldCount);
NODE_DEFINE_CONSTANT(target, kSessionHasRemoteSettingsListeners);