From 0e1efcb27309c0893e39bda9fed9dc2964300486 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 29 Sep 2023 09:12:08 -0500 Subject: [PATCH] Issue #1442 - Part 19 - FetchStream must support multiple read requests. https://bugzilla.mozilla.org/show_bug.cgi?id=1395220 --- dom/fetch/FetchStream.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dom/fetch/FetchStream.cpp b/dom/fetch/FetchStream.cpp index fa4802a990..ec224e1c8d 100644 --- a/dom/fetch/FetchStream.cpp +++ b/dom/fetch/FetchStream.cpp @@ -185,7 +185,13 @@ FetchStream::RequestDataCallback(JSContext* aCx, RefPtr stream = static_cast(aUnderlyingSource); MOZ_DIAGNOSTIC_ASSERT(stream->mState == eWaiting || - stream->mState == eChecking); + stream->mState == eChecking || + stream->mState == eReading); + + if (stream->mState == eReading) { + // We are already reading data. + return; + } if (stream->mState == eChecking) { // If we are looking for more data, there is nothing else we should do: