aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-18 02:34:58 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-18 02:34:58 -0700
commitfe77f6a2f3f4b90943123414f7dd21e6c68fa523 (patch)
treec92febc2e57f8ccb4d3929679248759e1909f73d
parentcd35218141a37ec1e1b39f4bf3ed48b7ac30d951 (diff)
downloadbun-fe77f6a2f3f4b90943123414f7dd21e6c68fa523.tar.gz
bun-fe77f6a2f3f4b90943123414f7dd21e6c68fa523.tar.zst
bun-fe77f6a2f3f4b90943123414f7dd21e6c68fa523.zip
Update http_client_async.zig
-rw-r--r--src/http_client_async.zig18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index d42603384..2ee1e4e6f 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -116,7 +116,7 @@ fn NewHTTPContext(comptime ssl: bool) type {
if (this.pending_sockets.get()) |pending| {
socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(pending).ptr());
socket.flush();
- socket.timeout(60);
+ socket.timeout(300);
pending.http_socket = socket;
@memcpy(&pending.hostname_buf, hostname.ptr, hostname.len);
@@ -306,11 +306,13 @@ fn NewHTTPContext(comptime ssl: bool) type {
client.connected_url.hostname = hostname;
if (comptime FeatureFlags.enable_keepalive) {
- if (this.existingSocket(hostname, port)) |sock| {
- sock.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(client).ptr());
- client.allow_retry = true;
- client.onOpen(comptime ssl, sock);
- return sock;
+ if (!client.disable_keepalive) {
+ if (this.existingSocket(hostname, port)) |sock| {
+ sock.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(client).ptr());
+ client.allow_retry = true;
+ client.onOpen(comptime ssl, sock);
+ return sock;
+ }
}
}
@@ -701,6 +703,10 @@ redirect: ?*URLBufferPool.Node = null,
timeout: usize = 0,
progress_node: ?*std.Progress.Node = null,
received_keep_alive: bool = false,
+
+disable_timeout: bool = false,
+disable_keepalive: bool = false,
+
state: InternalState = .{},
completion_callback: HTTPClientResult.Callback = undefined,