Skip to content

Commit fff623f

Browse files
committed
quic: fix fin handling, so it is broken
1 parent 04a8c62 commit fff623f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/internal/blob.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ async function* createBlobReaderIterable(reader, options = kEmptyObject) {
582582
const { getReadError } = options;
583583
let wakeup = PromiseWithResolvers();
584584
let immediate;
585-
reader.setWakeup(() => {
585+
let fin = false;
586+
reader.setWakeup((setfin) => {
587+
fin ||= setfin;
586588
immediate ??= setImmediate(() => {
587589
immediate = undefined;
588590
wakeup.resolve?.();
@@ -632,7 +634,7 @@ async function* createBlobReaderIterable(reader, options = kEmptyObject) {
632634
if (error) throw error;
633635

634636
if (blocked) {
635-
const fin = await wakeup.promise;
637+
await wakeup.promise;
636638
wakeup = PromiseWithResolvers();
637639
// If the wakeup was triggered by FIN (EndReadable), the DataQueue
638640
// is capped. Continue the loop to pull again -- the next pull will

0 commit comments

Comments
 (0)