zig

fork of https://codeberg.org/ziglang/zig
Log | Tree | Refs | README | LICENSE

commit 3817c7382b66bbac0c8f7ea4ff45685bb41b6a63 (tree)
parent aa090a49d94155c4804644377db110f3b13f0500
Author: Nameless <truemedian@gmail.com>
Date:   Tue, 22 Aug 2023 17:13:07 -0500

std.http: connectUnix return Unsupported on targets without unix sockets

Diffstat:
Mlib/std/http/Client.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig @@ -958,9 +958,11 @@ pub fn connectUnproxied(client: *Client, host: []const u8, port: u16, protocol: return conn; } -pub const ConnectUnixError = Allocator.Error || std.os.SocketError || error{NameTooLong} || std.os.ConnectError; +pub const ConnectUnixError = Allocator.Error || std.os.SocketError || error{ NameTooLong, Unsupported } || std.os.ConnectError; pub fn connectUnix(client: *Client, path: []const u8) ConnectUnixError!*ConnectionPool.Node { + if (!net.has_unix_sockets) return error.Unsupported; + if (client.connection_pool.findConnection(.{ .host = path, .port = 0,