perf(ext/node): improve node:http createServer performance (#29069)

This commit is contained in:
Yoshiya Hinosawa 2025-04-28 14:05:41 +09:00 committed by GitHub
parent 229228ae0d
commit 1df61020f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1499,7 +1499,11 @@ export const ServerResponse = function (
this._readable = readable;
this._resolve = resolve;
this.socket = socket;
this.socket?.on("close", () => this.end());
this.socket?.on("close", () => {
if (!this.finished) {
this.end();
}
});
this._header = "";
} as unknown as ServerResponseStatic;