mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
fix(ext/node): check resource exists before close (#23655)
This commit is contained in:
parent
56ba7f3c23
commit
811280af77
1 changed files with 12 additions and 6 deletions
|
@ -1015,7 +1015,7 @@ export class ClientHttp2Stream extends Duplex {
|
||||||
this.emit("trailers", trailers);
|
this.emit("trailers", trailers);
|
||||||
}
|
}
|
||||||
|
|
||||||
debugHttp2("tryClose");
|
debugHttp2(">>> tryClose", this[kDenoResponse]?.bodyRid);
|
||||||
core.tryClose(this[kDenoResponse].bodyRid);
|
core.tryClose(this[kDenoResponse].bodyRid);
|
||||||
this.push(null);
|
this.push(null);
|
||||||
debugHttp2(">>> read null chunk");
|
debugHttp2(">>> read null chunk");
|
||||||
|
@ -1246,10 +1246,12 @@ function finishCloseStream(stream, code) {
|
||||||
debugHttp2(
|
debugHttp2(
|
||||||
">>> finishCloseStream close",
|
">>> finishCloseStream close",
|
||||||
stream[kDenoRid],
|
stream[kDenoRid],
|
||||||
stream[kDenoResponse].bodyRid,
|
stream[kDenoResponse]?.bodyRid,
|
||||||
);
|
);
|
||||||
core.tryClose(stream[kDenoRid]);
|
core.tryClose(stream[kDenoRid]);
|
||||||
core.tryClose(stream[kDenoResponse].bodyRid);
|
if (stream[kDenoResponse]) {
|
||||||
|
core.tryClose(stream[kDenoResponse].bodyRid);
|
||||||
|
}
|
||||||
stream.emit("close");
|
stream.emit("close");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1265,7 +1267,9 @@ function finishCloseStream(stream, code) {
|
||||||
stream[kDenoResponse].bodyRid,
|
stream[kDenoResponse].bodyRid,
|
||||||
);
|
);
|
||||||
core.tryClose(stream[kDenoRid]);
|
core.tryClose(stream[kDenoRid]);
|
||||||
core.tryClose(stream[kDenoResponse].bodyRid);
|
if (stream[kDenoResponse]) {
|
||||||
|
core.tryClose(stream[kDenoResponse].bodyRid);
|
||||||
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
stream.emit("close");
|
stream.emit("close");
|
||||||
});
|
});
|
||||||
|
@ -1273,10 +1277,12 @@ function finishCloseStream(stream, code) {
|
||||||
debugHttp2(
|
debugHttp2(
|
||||||
">>> finishCloseStream close2 catch",
|
">>> finishCloseStream close2 catch",
|
||||||
stream[kDenoRid],
|
stream[kDenoRid],
|
||||||
stream[kDenoResponse].bodyRid,
|
stream[kDenoResponse]?.bodyRid,
|
||||||
);
|
);
|
||||||
core.tryClose(stream[kDenoRid]);
|
core.tryClose(stream[kDenoRid]);
|
||||||
core.tryClose(stream[kDenoResponse].bodyRid);
|
if (stream[kDenoResponse]) {
|
||||||
|
core.tryClose(stream[kDenoResponse].bodyRid);
|
||||||
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
stream.emit("close");
|
stream.emit("close");
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue