Commit d9ca50d
authored
Prevent sharing the index of the continuation frame header ByteBuf. (#13786)
Motivation:
The current implementation uses the `byteBuf` for a continuation frame
header multiple times if the header length exceeds `3 * maxFrameLength`.
However, it fails to slice the `byteBuf` during usage.
[Reference](https://github.com/netty/netty/blob/d027ba7320d430743992d613e52596b0182ca854/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2FrameWriter.java#L570)
Modification:
- Introduce `ByteBuf.retainedSlice()` for a continuation frame header
when it's used to prevent sharing the index.
Result:
- Correctly send continuation frame headers to the remote peer,
addressing the issue of reusing the index of the ByteBuf.1 parent 0e7c27c commit d9ca50d
2 files changed
Lines changed: 39 additions & 12 deletions
File tree
- codec-http2/src
- main/java/io/netty/handler/codec/http2
- test/java/io/netty/handler/codec/http2
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| |||
Lines changed: 38 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
210 | 214 | | |
211 | | - | |
212 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
213 | 243 | | |
214 | 244 | | |
215 | 245 | | |
216 | 246 | | |
217 | 247 | | |
218 | | - | |
219 | | - | |
| 248 | + | |
| 249 | + | |
220 | 250 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 251 | + | |
| 252 | + | |
226 | 253 | | |
227 | 254 | | |
228 | 255 | | |
| |||
0 commit comments