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...@@ -1282,14 +1282,12 @@ pub fn connectTcp(client: *Client, host: []const u8, port: u16, protocol: Connec
1282 return &conn.data;1282 return &conn.data;
1283}1283}
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
1287/// Connect to `path` as a unix domain socket. This will reuse a connection if one is already open.1287/// Connect to `path` as a unix domain socket. This will reuse a connection if one is already open.
1288///1288///
1289/// This function is threadsafe.1289/// This function is threadsafe.
1290pub fn connectUnix(client: *Client, path: []const u8) ConnectUnixError!*Connection {1290pub fn connectUnix(client: *Client, path: []const u8) ConnectUnixError!*Connection {
1291 if (!net.has_unix_sockets) return error.Unsupported;
1292
1293 if (client.connection_pool.findConnection(.{1291 if (client.connection_pool.findConnection(.{
1294 .host = path,1292 .host = path,
1295 .port = 0,1293 .port = 0,