Repository navigation
Commit ba42a2e
authored
stream: fix stale byte stream queue size
Re-read the byte controller's queue size before filling each pending
read request. A released BYOB reader can leave a partially filled
pull-into descriptor that is enqueued while a default reader has
multiple pending reads. Caching the queue size causes the loop to
dequeue from an empty queue after fulfilling the first read request.
Add a regression test for one, two, and three pending reads and verify
that any remaining queued bytes are preserved.
Signed-off-by: Mattias Buelens <mattias@buelens.com>
PR-URL: #67499
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent d32f1bd commit ba42a2e
2 files changed
Lines changed: 62 additions & 5 deletions
File tree
- lib/internal/webstreams
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3913 | 3913 | | |
3914 | 3914 | | |
3915 | 3915 | | |
3916 | | - | |
3917 | | - | |
3918 | | - | |
3919 | | - | |
| 3916 | + | |
| 3917 | + | |
3920 | 3918 | | |
3921 | 3919 | | |
3922 | 3920 | | |
3923 | 3921 | | |
3924 | | - | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
3925 | 3925 | | |
3926 | 3926 | | |
3927 | 3927 | | |
| |||
| 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments