Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Limit QUIC stream and field section sizes to protocol max - #356

Merged
normanmaurer merged 1 commit into
mainfrom
streams
Jan 12, 2026
Merged

Limit QUIC stream and field section sizes to protocol max#356
normanmaurer merged 1 commit into
mainfrom
streams

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Updated the default maxFieldSectionSize in Http3ConnectionHandler to
(2^62) - 1, aligning with QUIC variable-length integer limits defined in
RFC 9000. Introduced MAX_PEER_STREAMS_PER_STREAM_TYPE in
EmbeddedQuicChannel and enforced this maximum for peer allowed streams,
ensuring compliance with QUIC stream identifier constraints.

Motivation
QUIC uses 62-bit variable-length integers, allowing values up to (2^62)

    1. The previous default did not fully reflect this limit.
      Additionally, peer stream limits are applied per stream direction and
      initiator, but the current stream type model arbitrarily uses or allows
      Long.MAX_VALUE. This required enforcing a corrected maximum per stream
      type.

Modification
Set maxFieldSectionSize default to (2^62) - 1.
Introduced MAX_PEER_STREAMS_PER_STREAM_TYPE to ((1L << 62) - 1) / 2
Enforced the maximum when storing peer allowed stream counts.

Result
Aligns HTTP/3 settings and peer stream limits with RFC 9000 and prevents
invalid stream allocations.

This is a port of netty/netty#16117

Updated the default maxFieldSectionSize in Http3ConnectionHandler to
(2^62) - 1, aligning with QUIC variable-length integer limits defined in
RFC 9000. Introduced MAX_PEER_STREAMS_PER_STREAM_TYPE in
EmbeddedQuicChannel and enforced this maximum for peer allowed streams,
ensuring compliance with QUIC stream identifier constraints.

**Motivation**
QUIC uses 62-bit variable-length integers, allowing values up to (2^62)
- 1. The previous default did not fully reflect this limit.
Additionally, peer stream limits are applied per stream direction and
initiator, but the current stream type model arbitrarily uses or allows
Long.MAX_VALUE. This required enforcing a corrected maximum per stream
type.

**Modification**
Set maxFieldSectionSize default to (2^62) - 1.
Introduced MAX_PEER_STREAMS_PER_STREAM_TYPE to ((1L << 62) - 1) / 2
Enforced the maximum when storing peer allowed stream counts.

**Result**
Aligns HTTP/3 settings and peer stream limits with RFC 9000 and prevents
invalid stream allocations.

This is a port of netty/netty#16117
@normanmaurer normanmaurer added this to the 0.0.31.Final milestone Jan 12, 2026
@normanmaurer
normanmaurer merged commit ac684de into main Jan 12, 2026
5 checks passed
@normanmaurer
normanmaurer deleted the streams branch January 12, 2026 21:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant