mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/http): no response body reader when cancelling during shutdown (#14653)
This commit is contained in:
parent
a151092aa1
commit
4d82610700
1 changed files with 3 additions and 2 deletions
|
@ -270,11 +270,12 @@
|
|||
throw new TypeError("Unreachable");
|
||||
}
|
||||
const resourceRid = getReadableStreamRid(respBody);
|
||||
let reader;
|
||||
if (resourceRid) {
|
||||
if (respBody.locked) {
|
||||
throw new TypeError("ReadableStream is locked.");
|
||||
}
|
||||
const reader = respBody.getReader(); // Aquire JS lock.
|
||||
reader = respBody.getReader(); // Aquire JS lock.
|
||||
try {
|
||||
await core.opAsync(
|
||||
"op_http_write_resource",
|
||||
|
@ -296,7 +297,7 @@
|
|||
throw error;
|
||||
}
|
||||
} else {
|
||||
const reader = respBody.getReader();
|
||||
reader = respBody.getReader();
|
||||
while (true) {
|
||||
const { value, done } = await reader.read();
|
||||
if (done) break;
|
||||
|
|
Loading…
Reference in a new issue