stream: skip zero-byte broadcast writes · nodejs/node@fc80ff5 · GitHub
Skip to content

Commit fc80ff5

Browse files
trivikraduh95
authored andcommitted
stream: skip zero-byte broadcast writes
Zero-byte writes append entries to the broadcast buffer without increasing bufferedBytes. This allows write('') and writev([]) to bypass backpressure and grow the buffer without bound. Treat zero-byte batches as successful no-ops, matching push streams, and add coverage for the synchronous and asynchronous writer methods. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol PR-URL: #64772 Fixes: #64771 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 5109092 commit fc80ff5

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

lib/internal/streams/iter/broadcast.js

Lines changed: 6 additions & 1 deletion

test/parallel/test-stream-iter-broadcast-backpressure.js

Lines changed: 21 additions & 0 deletions

0 commit comments

Comments
 (0)