Commit 044aae0
committed
Return InvalidStreamState from stream_send() for collected streams
When a stream has been completed and garbage collected (for example
after the peer sends STOP_SENDING, the fin bit is received, and the
data is drained via stream_recv()), a subsequent stream_send() call
hits get_or_create() for an id that is in the collected set, which
returns Error::Done. That error was forwarded unchanged, so callers
saw Done (normally "no capacity") for a stream that no longer exists.
Map that case to Error::InvalidStreamState instead, matching the
behaviour of stream_recv() which already returns InvalidStreamState
for a non-existent stream. This lets applications distinguish a lack
of send capacity from an invalid stream id without an extra
stream_writable() check.
Fixes #16951 parent f0c7193 commit 044aae0
3 files changed
Lines changed: 70 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6025 | 6025 | | |
6026 | 6026 | | |
6027 | 6027 | | |
| 6028 | + | |
| 6029 | + | |
| 6030 | + | |
| 6031 | + | |
6028 | 6032 | | |
6029 | 6033 | | |
6030 | 6034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3472 | 3472 | | |
3473 | 3473 | | |
3474 | 3474 | | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
3475 | 3507 | | |
3476 | 3508 | | |
3477 | 3509 | | |
| |||
5541 | 5573 | | |
5542 | 5574 | | |
5543 | 5575 | | |
5544 | | - | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
5545 | 5580 | | |
5546 | 5581 | | |
5547 | 5582 | | |
| |||
11810 | 11845 | | |
11811 | 11846 | | |
11812 | 11847 | | |
11813 | | - | |
11814 | | - | |
11815 | | - | |
| 11848 | + | |
| 11849 | + | |
| 11850 | + | |
| 11851 | + | |
| 11852 | + | |
11816 | 11853 | | |
11817 | 11854 | | |
11818 | 11855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments