Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
stream: fix async iter not reading last chunk on close
The async iterator can sometimes miss the last chunk
when there has been an asynchronous event
and a null chunk as used by
test-quic-simple-server-uni.js

Fixes: #35789
  • Loading branch information
mmomtchev committed Oct 25, 2020
commit 01f0d7249873d7a619eb57b4767942526d3beebc
2 changes: 1 addition & 1 deletion lib/internal/streams/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ async function* createAsyncIterator(stream) {

try {
while (true) {
const chunk = stream.destroyed ? null : stream.read();
const chunk = errorEmitted ? null : stream.read();
if (chunk !== null) {
yield chunk;
} else if (errorEmitted) {
Expand Down