Commit 640b6b7
Fix - Http3FrameCodec decode fail during unknown settings (#15998)
**Motivation:**
The change in
[https://github.com/netty/netty/pull/15909](https://github.com/netty/netty/pull/15909)
is merged but not yet released. While working on HTTP/3 connections I
noticed a logical issue: when an unknown settings key is received, the
current implementation returns a value, which causes Http3FrameCodec to
treat it as an error (because settings.put(key, value) returns the
previous value for known keys and null for new ones). For unknown keys
we should ignore them, so we now always return null to achieve the
expected behavior.
**Modification:**
* [x] settings.put(key, value) now returns null for unknown keys (non
null triggers an error in Http3FrameCodec decoding).
* [x] Added unit tests to verify this.
> Note: Http3CodecTest didn’t catch the issue previously because it used
frames produced by the same put logic, so both encoding and decoding
behaved consistently and the issue was hidden.
---------
Co-authored-by: Norman Maurer <norman_maurer@apple.com>1 parent 35f6ad1 commit 640b6b7
3 files changed
Lines changed: 45 additions & 7 deletions
File tree
- codec-http3/src
- main/java/io/netty/handler/codec/http3
- test/java/io/netty/handler/codec/http3
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 94 | + | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
267 | 309 | | |
0 commit comments