Commit 0c7d43e
authored
Http3RequestStream: read EOS after trailers (#117026)
This fixes the primary bug captured in #60118 without attempting to drain the stream and without touching the Dispose logic.
We expect trailers to be sent in a single HEADER frame, which is read by `ReadHeadersAsync` but that method doesn't read the EOS. Despite of that, we set `_responseDataPayloadRemaining = -1` afterwards
https://github.com/dotnet/runtime/blob/27c8fe04453195039686fb375a73fac7ff1ea968/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs#L577-L583
which then makes `Http3RequestStream` pretend that it reached EOS in subsequent read calls without ever trying to issue the read to the underlying `QuicStream`:
https://github.com/dotnet/runtime/blob/0d628dae1cb5b8d0eb76d9549134edfe30d6219c/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs#L1340-L1344
This can be easily fixed by issuing one more read after reading the headers.1 parent 5545d52 commit 0c7d43e
File tree
2 files changed
+87
-18
lines changed- src/libraries/System.Net.Http
- src/System/Net/Http/SocketsHttpHandler
- tests/FunctionalTests
2 files changed
+87
-18
lines changedLines changed: 24 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
577 | 572 | | |
578 | 573 | | |
579 | 574 | | |
| |||
601 | 596 | | |
602 | 597 | | |
603 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
604 | 618 | | |
605 | 619 | | |
606 | 620 | | |
| |||
1367 | 1381 | | |
1368 | 1382 | | |
1369 | 1383 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
| 1384 | + | |
| 1385 | + | |
1376 | 1386 | | |
1377 | | - | |
1378 | | - | |
1379 | 1387 | | |
1380 | 1388 | | |
1381 | 1389 | | |
| |||
Lines changed: 63 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
1285 | 1283 | | |
1286 | 1284 | | |
1287 | 1285 | | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1288 | 1349 | | |
1289 | 1350 | | |
1290 | 1351 | | |
| |||
0 commit comments