1
0
Fork 0
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:
Divy Srivastava 2022-05-18 16:13:22 +05:30 committed by GitHub
parent a151092aa1
commit 4d82610700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;