h2_settings (h2 v0.6.0)
View SourceHTTP/2 Settings (RFC 7540 Section 6.5)
Settings are used to communicate configuration parameters between HTTP/2 endpoints. Each setting is identified by a 16-bit identifier and has a 32-bit value.
Summary
Functions
Decode binary SETTINGS frame payload to settings map.
Return the default settings values.
Encode settings to binary for SETTINGS frame payload.
Get a setting value.
Merge new settings into existing settings.
Set a setting value.
Validate settings values (mode-agnostic). Returns ok if valid, or {error, {setting, Reason}} if invalid.
Validate settings values from the perspective of the given mode. Matters for RFC 9113 §6.5.2 -- a client that receives SETTINGS_ENABLE_PUSH with any value other than 0 MUST treat this as a connection PROTOCOL_ERROR. Servers enforce only the 0|1 range.
Types
-type settings() :: #{header_table_size => non_neg_integer(), enable_push => 0 | 1, max_concurrent_streams => non_neg_integer() | unlimited, initial_window_size => non_neg_integer(), max_frame_size => non_neg_integer(), max_header_list_size => non_neg_integer() | unlimited, enable_connect_protocol => 0 | 1, wt_initial_max_data => non_neg_integer(), wt_initial_max_stream_data_uni => non_neg_integer(), wt_initial_max_stream_data_bidi_local => non_neg_integer(), wt_initial_max_stream_data_bidi_remote => non_neg_integer(), wt_initial_max_streams_uni => non_neg_integer(), wt_initial_max_streams_bidi => non_neg_integer(), non_neg_integer() => non_neg_integer()}.
Functions
Decode binary SETTINGS frame payload to settings map.
-spec default() -> settings().
Return the default settings values.
Encode settings to binary for SETTINGS frame payload.
Get a setting value.
Merge new settings into existing settings.
Set a setting value.
Validate settings values (mode-agnostic). Returns ok if valid, or {error, {setting, Reason}} if invalid.
Validate settings values from the perspective of the given mode. Matters for RFC 9113 §6.5.2 -- a client that receives SETTINGS_ENABLE_PUSH with any value other than 0 MUST treat this as a connection PROTOCOL_ERROR. Servers enforce only the 0|1 range.