diff options
author | Luca Casonato <hello@lcas.dev> | 2022-09-30 07:54:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-30 07:54:12 +0200 |
commit | 20c7300412bdb487fc758577d6256bbcf96efd12 (patch) | |
tree | 2dcd218a6095a2ad143fb27e304391b5fe64cf27 /ext/flash/01_http.js | |
parent | 38f544538b337074cbce317e67859a69bb23684c (diff) |
refactor(ext/http): remove op_http_read (#16096)
We can use Resource::read_return & op_read instead. This allows HTTP
request bodies to participate in FastStream.
To make this work, `readableStreamForRid` required a change to allow non
auto-closing resources to be handled. This required some minor changes
in our FastStream paths in ext/http and ext/flash.
Diffstat (limited to 'ext/flash/01_http.js')
-rw-r--r-- | ext/flash/01_http.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/flash/01_http.js b/ext/flash/01_http.js index fcea23a95..789979ff9 100644 --- a/ext/flash/01_http.js +++ b/ext/flash/01_http.js @@ -10,7 +10,7 @@ const { ReadableStream, ReadableStreamPrototype, - getReadableStreamRid, + getReadableStreamResourceBacking, readableStreamClose, _state, } = window.__bootstrap.streams; @@ -333,8 +333,8 @@ } if (isStreamingResponseBody === true) { - const resourceRid = getReadableStreamRid(respBody); - if (resourceRid) { + const resourceBacking = getReadableStreamResourceBacking(respBody); + if (resourceBacking) { if (respBody.locked) { throw new TypeError("ReadableStream is locked."); } @@ -352,7 +352,8 @@ ), serverId, i, - resourceRid, + resourceBacking.rid, + resourceBacking.autoClose, ).then(() => { // Release JS lock. readableStreamClose(respBody); |