authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-17 11:48:42-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:37:11-07:00
loge204b2ca92d095cef03cee123881fd1d9f1004d0
tree5405ba2d42cf1e63ac438adb74acca10a64a72d6
parent6de8748b057d99d6003e1d4a5f7fb027776522ad

std.http.Client.connectUnix: handle unsupported OS at compile time


1 files changed, 1 insertions(+), 3 deletions(-)

lib/std/http/Client.zig+1-3
......@@ -1282,14 +1282,12 @@ pub fn connectTcp(client: *Client, host: []const u8, port: u16, protocol: Connec
12821282 return &conn.data;
12831283}
12841284
1285pub const ConnectUnixError = Allocator.Error || std.os.SocketError || error{ NameTooLong, Unsupported } || std.os.ConnectError;
1285pub const ConnectUnixError = Allocator.Error || std.os.SocketError || error{NameTooLong} || std.os.ConnectError;
12861286
12871287/// Connect to `path` as a unix domain socket. This will reuse a connection if one is already open.
12881288///
12891289/// This function is threadsafe.
12901290pub fn connectUnix(client: *Client, path: []const u8) ConnectUnixError!*Connection {
1291 if (!net.has_unix_sockets) return error.Unsupported;
1292
12931291 if (client.connection_pool.findConnection(.{
12941292 .host = path,
12951293 .port = 0,