Don't call the onTimeout handler if the socket is closed, shutdown, or detached

This commit is contained in:
Jarred Sumner
2024-07-28 19:29:58 -07:00
parent 7cb8e14d52
commit c1122d65e6

View File

@@ -1296,7 +1296,7 @@ fn NewSocket(comptime ssl: bool) type {
) void {
JSC.markBinding(@src());
log("onTimeout", .{});
if (this.detached) return;
if (this.detached or this.socket.isShutdown() or this.socket.isClosed()) return;
const handlers = this.handlers;
const callback = handlers.onTimeout;