Zig Version
0.16.0-dev.2623+27eec9bd6
Steps to Reproduce and Observed Behavior
It seems like the ConnectTcpOptions.timeout is not used.
This diff would fix it:
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig
index bc0e3ec0ff..6e1473e72d 100644
--- a/lib/std/http/Client.zig
+++ b/lib/std/http/Client.zig
@@ -1438,6 +1438,7 @@ pub fn connectTcpOptions(client: *Client, options: ConnectTcpOptions) ConnectTcp
const host = options.host;
const port = options.port;
const protocol = options.protocol;
+ const timeout = options.timeout;
const proxied_host = options.proxied_host orelse host;
const proxied_port = options.proxied_port orelse port;
@@ -1448,7 +1449,7 @@ pub fn connectTcpOptions(client: *Client, options: ConnectTcpOptions) ConnectTcp
.protocol = protocol,
})) |conn| return conn;
- var stream = try host.connect(io, port, .{ .mode = .stream });
+ var stream = try host.connect(io, port, .{ .mode = .stream, .timeout = timeout });
errdefer stream.close(io);
switch (protocol) {
but there is connectProxied() and connectTcp() which don't have timeout arguments yet.
I'm not sure where in the API to set the timeout so it would be respected on typical usages.
Expected Behavior
Use a connect timeout.
### Zig Version
0.16.0-dev.2623+27eec9bd6
### Steps to Reproduce and Observed Behavior
It seems like the ``ConnectTcpOptions.timeout`` is not used.
This diff would fix it:
```diff
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig
index bc0e3ec0ff..6e1473e72d 100644
--- a/lib/std/http/Client.zig
+++ b/lib/std/http/Client.zig
@@ -1438,6 +1438,7 @@ pub fn connectTcpOptions(client: *Client, options: ConnectTcpOptions) ConnectTcp
const host = options.host;
const port = options.port;
const protocol = options.protocol;
+ const timeout = options.timeout;
const proxied_host = options.proxied_host orelse host;
const proxied_port = options.proxied_port orelse port;
@@ -1448,7 +1449,7 @@ pub fn connectTcpOptions(client: *Client, options: ConnectTcpOptions) ConnectTcp
.protocol = protocol,
})) |conn| return conn;
- var stream = try host.connect(io, port, .{ .mode = .stream });
+ var stream = try host.connect(io, port, .{ .mode = .stream, .timeout = timeout });
errdefer stream.close(io);
switch (protocol) {
```
but there is ``connectProxied()`` and ``connectTcp()`` which don't have ``timeout`` arguments yet.
I'm not sure where in the API to set the timeout so it would be respected on typical usages.
### Expected Behavior
Use a connect timeout.