mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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: https://github.com/nodejs/node/pull/67499 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>