class

HTTP2::Connection::Configuration

Inherits Reference < Object

Resource limits and the SETTINGS sent in the client connection preface.

Constructors

new(inbound_max_frame_size : Int32 = FrameHeader::DEFAULT_MAX_PAYLOAD, writer_queue_capacity : Int32 = 32, stream_event_capacity : Int32 = 32, max_open_streams : Int32 = 100, max_pending_settings : Int32 = 8, max_pending_pings : Int32 = 8, max_pre_ack_push_promises : Int32 = 8, settings_ack_timeout : Time::Span = 10.seconds, drain_timeout : Time::Span = 30.seconds, goaway_flush_timeout : Time::Span = 5.seconds, keepalive_interval : Time::Span | Nil = nil, keepalive_timeout : Time::Span = 10.seconds, max_compressed_field_section_size : Int32 = 64 * 1024, max_decoded_field_section_size : Int32 = 64 * 1024, max_decoded_fields : Int32 = 1024, max_decoded_string_size : Int32 | Nil = nil, max_continuation_frames : Int32 = 16, max_encoder_table_size : Int32 = 64 * 1024, max_decoder_table_size : Int32 = 64 * 1024, max_retained_closed_streams : Int32 = 256, closed_stream_retention : Time::Span = 30.seconds, max_buffered_body_bytes : Int32 = SettingsState::DEFAULT_INITIAL_WINDOW_SIZE.to_i32, connection_receive_window : Int32 = 1048576, outbound_data_chunk_size : Int32 = FrameHeader::DEFAULT_MAX_PAYLOAD, inbound_frame_rate_window : Time::Span = 1.second, max_control_frames_per_window : Int32 = 1000, max_empty_frames_per_window : Int32 = 1000, diagnostic_queue_capacity : Int32 = 128, initial_settings : Enumerable(Frame::Settings::Setting) = [] of Frame::Settings::Setting)
Source

Instance methods

closed_stream_retention
Source
connection_receive_window
Source
diagnostic_queue_capacity
Source
drain_timeout
Source
goaway_flush_timeout
Source
inbound_frame_rate_window
Source
inbound_max_frame_size
Source
initial_settings
Source
keepalive_interval
Source
keepalive_timeout
Source
max_buffered_body_bytes
Source
max_compressed_field_section_size
Source
max_continuation_frames
Source
max_control_frames_per_window
Source
max_decoded_field_section_size
Source
max_decoded_fields

An additional defense-in-depth cap on the number of fields a single decoded section may contain. Neither RFC 9113 nor RFC 7541 impose any field-count limit of their own — only the byte-size bounds (max_compressed_field_section_size, max_decoded_field_section_size) are protocol-adjacent. A too-low count limit rejects legitimate, if unusual, requests (large cookie jars, tracing/baggage headers, etc.) that were never actually a resource risk.

This getter's default does not newly exceed what the byte-size cap already permits: the HPack field-section-size accounting this library uses charges name.bytesize + value.bytesize + 32 per field (RFC 7541's dynamic-table-size formula, reused here for the section limit), so even a maximally degenerate all-empty-valued section already fits roughly 65_536 / 32 = 2_048 fields under the ~64 KiB max_decoded_field_section_size default regardless of this setting — the byte cap alone already lets a peer reach that many fields, as long as each one stays near the fixed 32-byte floor; it takes many SMALL fields to get there, not a few large-valued ones. This getter's default (1_024) stays comfortably under that implicit ~2_048 ceiling, not above it — it does not, by itself, keep a large field count out; it only avoids rejecting a legitimate, unusually field-heavy request while staying within what the byte cap alone already allows.

Source
max_decoded_string_size
Source
max_decoder_table_size
Source
max_empty_frames_per_window
Source
max_encoder_table_size
Source
max_open_streams
Source
max_pending_pings
Source
max_pending_settings
Source
max_pre_ack_push_promises
Source
max_retained_closed_streams
Source
outbound_data_chunk_size
Source
settings_ack_timeout
Source
stream_event_capacity
Source
writer_queue_capacity
Source