From 3fddaf8fae1cd655466b6237a70ee81a13003537 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 22 Mar 2018 12:26:27 +0100 Subject: [PATCH] Readable byte stream must call pull if needed after receiving new chunk After a readable byte stream receives a new chunk from the underlying source, the stream must call pull() (if needed). Otherwise, the stream may get stuck. Add calls to ReadableByteStreamControllerCallPullIfNeeded at the end of ReadableByteStreamControllerEnqueue and ReadableByteStreamControllerRespondInternal to ensure this. Fixes #877. --- index.bs | 2 ++ reference-implementation/lib/readable-stream.js | 4 ++++ reference-implementation/web-platform-tests | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 3ee835cd4..944836f09 100644 --- a/index.bs +++ b/index.bs @@ -2428,6 +2428,7 @@ nothrow>ReadableByteStreamControllerEnqueue ( controller, chunk< 1. Assert: ! IsReadableStreamLocked(_stream_) is *false*. 1. Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(_controller_, _transferredBuffer_, _byteOffset_, _byteLength_). + 1. Perform ! ReadableByteStreamControllerCallPullIfNeeded(_controller_).

ReadableByteStreamControllerRespondInternal ( controller,