Repository navigation
Commit 01f4238
committed
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>1 parent 537a20c commit 01f4238
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 | |
|---|---|---|---|
| |||
3860 | 3860 | | |
3861 | 3861 | | |
3862 | 3862 | | |
3863 | | - | |
3864 | | - | |
3865 | | - | |
3866 | | - | |
| 3863 | + | |
| 3864 | + | |
3867 | 3865 | | |
3868 | 3866 | | |
3869 | 3867 | | |
3870 | 3868 | | |
3871 | | - | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
3872 | 3872 | | |
3873 | 3873 | | |
3874 | 3874 | | |
| |||
| 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