authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-08-19 23:27:14-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-08-19 23:27:14-07:00
log7988f79528e2105a83bc00b91866b639b181dd51
tree2c6bcb15da9964f411254c8ffe0713c956ade140
parent1280033c27f2d3276263b52018c0bd911dbf5950

Io.Threaded.netLookupFallible: map TIMEOUT to error.NameServerFailure on Windows

This matches the error used in lookupDns when ResolvConf.timeout_seconds has elapsed as well as what EAI_AGAIN gets mapped to when using getaddrinfo

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

lib/std/Io/Threaded.zig+1-1
......@@ -13982,7 +13982,7 @@ fn netLookupFallible(
1398213982 .DNS_ERROR_INVALID_NAME_CHAR,
1398313983 .DNS_ERROR_RECORD_DOES_NOT_EXIST,
1398413984 => return error.UnknownHostName,
13985 .TIMEOUT => return error.Timeout,
13985 .TIMEOUT => return error.NameServerFailure,
1398613986 else => |err| return windows.unexpectedError(err),
1398713987 }
1398813988 }
lib/std/Io/net/HostName.zig-1
......@@ -156,7 +156,6 @@ pub const LookupError = error{
156156 NoAddressReturned,
157157 /// Failed to open or read "/etc/hosts" or "/etc/resolv.conf".
158158 DetectingNetworkConfigurationFailed,
159 Timeout,
160159} || IpAddress.BindError || Io.Cancelable;
161160
162161pub const LookupResult = union(enum) {
lib/std/Io/net/test.zig-1
......@@ -173,7 +173,6 @@ test "resolve DNS" {
173173 }) catch |err| switch (err) {
174174 error.UnknownHostName => return error.SkipZigTest,
175175 error.NameServerFailure => return error.SkipZigTest,
176 error.Timeout => return error.SkipZigTest,
177176 else => |e| return e,
178177 };
179178