From 38dd9e9c575b1970f71be57cc19a1db8855c1f1a Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Sat, 24 Jun 2023 18:20:38 -0700 Subject: [PATCH] further fix --- src/server/lib/files.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/lib/files.ts b/src/server/lib/files.ts index 63011c5..66063e3 100644 --- a/src/server/lib/files.ts +++ b/src/server/lib/files.ts @@ -350,9 +350,11 @@ export default class Files { getNextChunk().then(async (nextChunk) => { if (nextChunk == "__ERR") {this.destroy(new Error("file read error")); return} let response = this.push(nextChunk) - + while (response) { - response = this.push(await getNextChunk()) + let nextChunk = await getNextChunk() + response = this.push(nextChunk) + if (!nextChunk) return } }) }