This repository was archived by the owner on May 8, 2026. It is now read-only.
Commit ac684de
authored
Limit QUIC stream and field section sizes to protocol max (#356)
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#161171 parent 4374490 commit ac684de
2 files changed
Lines changed: 18 additions & 3 deletions
File tree
- src
- main/java/io/netty/incubator/codec/http3
- test/java/io/netty/incubator/codec/http3
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
143 | | - | |
| 154 | + | |
144 | 155 | | |
145 | 156 | | |
146 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
147 | 161 | | |
148 | 162 | | |
149 | 163 | | |
| |||
0 commit comments