stream/internal: don't abort immediately after close for generic streams (#584)
* stream: move closeRequest to shared functions * stream: use closeRequest instead of abort() directly * stream/internal: don't abort immediately after close for generic streams
This commit is contained in:
@@ -5,6 +5,7 @@ import { nanoid } from "nanoid";
|
||||
import { decryptStream, encryptStream, generateHmac } from "../sub/crypto.js";
|
||||
import { env } from "../config.js";
|
||||
import { strict as assert } from "assert";
|
||||
import { closeRequest } from "./shared.js";
|
||||
|
||||
// optional dependency
|
||||
const freebind = env.freebindCIDR && await import('freebind').catch(() => {});
|
||||
@@ -109,7 +110,7 @@ export function destroyInternalStream(url) {
|
||||
const id = url.searchParams.get('id');
|
||||
|
||||
if (internalStreamCache[id]) {
|
||||
internalStreamCache[id].controller.abort();
|
||||
closeRequest(internalStreamCache[id].controller);
|
||||
delete internalStreamCache[id];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user