pub struct H2FloodConfig {Show 13 fields
pub max_rst_stream_per_window: u32,
pub max_ping_per_window: u32,
pub max_settings_per_window: u32,
pub max_empty_data_per_window: u32,
pub max_window_update_stream0_per_window: u32,
pub max_continuation_frames: u32,
pub max_glitch_count: u32,
pub max_rst_stream_lifetime: u64,
pub max_rst_stream_abusive_lifetime: u64,
pub max_rst_stream_emitted_lifetime: u64,
pub max_header_list_size: u32,
pub max_header_table_size: u32,
pub max_header_fields: u32,
}Expand description
Configurable thresholds for H2 flood detection.
All values have safe defaults matching the compile-time constants.
When configured via listener config, None values fall back to these defaults.
Fields§
§max_rst_stream_per_window: u32Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
max_ping_per_window: u32Maximum PING frames per second window (CVE-2019-9512)
max_settings_per_window: u32Maximum SETTINGS frames per second window (CVE-2019-9515)
max_empty_data_per_window: u32Maximum empty DATA frames per second window (CVE-2019-9518)
max_window_update_stream0_per_window: u32Maximum connection-level (stream 0) WINDOW_UPDATE frames per sliding window. Caps the CPU cost of a peer sending a flood of non-zero stream-0 WINDOW_UPDATEs — each is individually legal so the generic glitch counter does not trip, yet millions per connection still burn server CPU parsing and updating the flow window.
max_continuation_frames: u32Maximum CONTINUATION frames per header block (CVE-2024-27316)
max_glitch_count: u32Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
max_rst_stream_lifetime: u64Absolute lifetime cap on RST_STREAM frames received on a single connection (CVE-2023-44487). Never decays — provides a ceiling the per-window counter cannot.
max_rst_stream_abusive_lifetime: u64Lifetime cap on “abusive” (pre-response-start) RST_STREAM frames — the Rapid Reset signature (CVE-2023-44487).
max_rst_stream_emitted_lifetime: u64Absolute lifetime cap on server-emitted RST_STREAM frames for this
connection (CVE-2025-8671 “MadeYouReset”). Only non-NoError resets
count — graceful cancels are exempt.
max_header_list_size: u32Maximum accumulated HPACK-decoded header list size per request (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2).
max_header_table_size: u32Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted from the peer. Caps the value the peer advertises in SETTINGS frames to prevent unbounded HPACK encoder memory growth.
max_header_fields: u32Maximum number of materialized header fields, enforced per HEADERS block
and (independently) per trailers block — HPACK fields plus expanded
cookie crumbs (RFC 9113 §8.2.3). Bounds the HPACK indexed-reference
header bomb, where many 1-byte indexed references each materialize a
Pair of per-entry bookkeeping.
Implementations§
Source§impl H2FloodConfig
impl H2FloodConfig
Sourcepub fn new(
max_rst_stream_per_window: u32,
max_ping_per_window: u32,
max_settings_per_window: u32,
max_empty_data_per_window: u32,
max_window_update_stream0_per_window: u32,
max_continuation_frames: u32,
max_glitch_count: u32,
max_rst_stream_lifetime: u64,
max_rst_stream_abusive_lifetime: u64,
max_rst_stream_emitted_lifetime: u64,
max_header_list_size: u32,
max_header_table_size: u32,
max_header_fields: u32,
) -> Self
pub fn new( max_rst_stream_per_window: u32, max_ping_per_window: u32, max_settings_per_window: u32, max_empty_data_per_window: u32, max_window_update_stream0_per_window: u32, max_continuation_frames: u32, max_glitch_count: u32, max_rst_stream_lifetime: u64, max_rst_stream_abusive_lifetime: u64, max_rst_stream_emitted_lifetime: u64, max_header_list_size: u32, max_header_table_size: u32, max_header_fields: u32, ) -> Self
Create a validated config, clamping all thresholds to at least 1. Zero thresholds would cause immediate flood detection on any frame.
Trait Implementations§
Source§impl Clone for H2FloodConfig
impl Clone for H2FloodConfig
Source§fn clone(&self) -> H2FloodConfig
fn clone(&self) -> H2FloodConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for H2FloodConfig
Source§impl Debug for H2FloodConfig
impl Debug for H2FloodConfig
Source§impl Default for H2FloodConfig
impl Default for H2FloodConfig
impl Eq for H2FloodConfig
Source§impl PartialEq for H2FloodConfig
impl PartialEq for H2FloodConfig
Source§fn eq(&self, other: &H2FloodConfig) -> bool
fn eq(&self, other: &H2FloodConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for H2FloodConfig
Auto Trait Implementations§
impl Freeze for H2FloodConfig
impl RefUnwindSafe for H2FloodConfig
impl Send for H2FloodConfig
impl Sync for H2FloodConfig
impl Unpin for H2FloodConfig
impl UnsafeUnpin for H2FloodConfig
impl UnwindSafe for H2FloodConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.