Skip to main content

MAX_PEER_UNI_STREAMS

Constant MAX_PEER_UNI_STREAMS 

Source
pub const MAX_PEER_UNI_STREAMS: u32 = 16;
Expand description

Unidirectional streams a peer may have open on one connection at a time.

HTTP/3 gives a client exactly three of them — the control stream and the QPACK encoder/decoder pair (RFC 9114 §6.2, RFC 9204 §4.2) — and Surge opens those three and nothing else. Everything past them is either an unknown type, which RFC 9114 §6.2 has this server abort rather than reject, or a second stream of a kind that may only be opened once, which is a connection error. So no client that behaves needs a fourth, and a peer that opens them anyway costs a task each while it says nothing.

Sixteen rather than three: this is a transport parameter, so exceeding it is a QUIC-level failure with no application-level explanation attached, and the margin means an ordinary client can only meet it by doing something the HTTP/3 layer would refuse anyway. The number this replaces is quinn’s own default of 100, which this server had never taken a position on — the bidi limit beside it has been a configuration key all along (review L3).