aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-10-02 18:01:59 -0700
committerGravatar GitHub <noreply@github.com> 2023-10-02 18:01:59 -0700
commitb444c0b98db6dee5a10d680f30ba1c0fbff4f285 (patch)
tree492e3fe1e72096c7c5d1b9df325c48cd2954f232 /src/bun.js
parent15880308b78647755c59a3b656db52e9230d9c3d (diff)
downloadbun-b444c0b98db6dee5a10d680f30ba1c0fbff4f285.tar.gz
bun-b444c0b98db6dee5a10d680f30ba1c0fbff4f285.tar.zst
bun-b444c0b98db6dee5a10d680f30ba1c0fbff4f285.zip
Set `fetch` timeout to 5 minutes (#6217)
* Increase timeouts * Update uws.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/api/bun/socket.zig15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index a8c0948d9..752adea1e 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -771,7 +771,7 @@ pub const Listener = struct {
Socket.dataSetCached(this_socket.getThisValue(globalObject), globalObject, default_data);
}
socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, this_socket);
- socket.timeout(120000);
+ socket.setTimeout(120000);
}
// pub fn addServerName(this: *Listener, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSValue {
@@ -1599,7 +1599,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- this.socket.timeout(@as(c_uint, @intCast(t)));
+ this.socket.setTimeout(@as(c_uint, @intCast(t)));
return JSValue.jsUndefined();
}
@@ -2962,6 +2962,17 @@ pub fn NewWrappedHandler(comptime tls: bool) type {
}
}
+ pub fn onLongTimeout(
+ this: WrappedSocket,
+ socket: Socket,
+ ) void {
+ if (comptime tls) {
+ TLSSocket.onTimeout(this.tls, socket);
+ } else {
+ TLSSocket.onTimeout(this.tcp, socket);
+ }
+ }
+
pub fn onConnectError(
this: WrappedSocket,
socket: Socket,