wt_h2_init (webtransport v0.2.5)

View Source

WebTransport-Init structured-field header (draft-14 §4.3.2).

The WebTransport-Init request header is an RFC 8941 Dictionary with integer values. Defined keys: u - initial max stream count for unidirectional streams opened by the recipient bl - initial max stream count for bidirectional streams opened by the sender br - initial max stream count for bidirectional streams opened by the recipient

When both HTTP/2 SETTINGS and WebTransport-Init are present, the endpoint MUST use the greater of the two values for each field.

Summary

Functions

Merge WebTransport-Init values with local defaults, taking the greater of each field (draft-14 §4.3.2).

Encode a WebTransport-Init header value. Produces an RFC 8941 Dictionary in its simplest form: key=value, ....

Parse a WebTransport-Init header value. Accepts the RFC 8941 Dictionary subset we emit: key=integer, ....

Types

init_params/0

-type init_params() :: #{u => non_neg_integer(), bl => non_neg_integer(), br => non_neg_integer()}.

Functions

apply_greater_of(Init, Defaults)

-spec apply_greater_of(init_params(), init_params()) -> init_params().

Merge WebTransport-Init values with local defaults, taking the greater of each field (draft-14 §4.3.2).

encode(Params)

-spec encode(init_params()) -> binary().

Encode a WebTransport-Init header value. Produces an RFC 8941 Dictionary in its simplest form: key=value, ....

parse(Bin)

-spec parse(binary()) -> {ok, init_params()} | {error, term()}.

Parse a WebTransport-Init header value. Accepts the RFC 8941 Dictionary subset we emit: key=integer, ....