authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2026-04-22 10:35:05-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-25 05:20:16+02:00
log23bcb8148fb12d86b003708b6410d98a986d2d9f
treea94362538e4ae720610558efd82c673d6ebe91d7
parentfb9ba5e4b315e76c3ff1d01ebd56c651e13c314d

add missing CONNECTION_REFUSED and CONNECTION_RESET errors for windows

Adds missing errors CONNECTION_REFUSED for netConnectIpWindows and CONNECTION_RESET for both netReadWindows and netWriteWindows. I'm able to induce these 3 errors on my Windows 11 machine.

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

lib/std/Io/Threaded.zig+3
...@@ -12255,6 +12255,7 @@ fn netConnectIpWindows(...@@ -12255,6 +12255,7 @@ fn netConnectIpWindows(
12255 .SUCCESS => {},12255 .SUCCESS => {},
12256 .CANCELLED => unreachable,12256 .CANCELLED => unreachable,
12257 .INSUFFICIENT_RESOURCES => return error.SystemResources,12257 .INSUFFICIENT_RESOURCES => return error.SystemResources,
12258 .CONNECTION_REFUSED => return error.ConnectionRefused,
12258 else => |status| return windows.unexpectedStatus(status),12259 else => |status| return windows.unexpectedStatus(status),
12259 }12260 }
12260 return .{ .handle = socket_handle, .address = bound_address };12261 return .{ .handle = socket_handle, .address = bound_address };
...@@ -12792,6 +12793,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea...@@ -12792,6 +12793,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea
12792 .SUCCESS => return iosb.Information,12793 .SUCCESS => return iosb.Information,
12793 .CANCELLED => unreachable,12794 .CANCELLED => unreachable,
12794 .INSUFFICIENT_RESOURCES => return error.SystemResources,12795 .INSUFFICIENT_RESOURCES => return error.SystemResources,
12796 .CONNECTION_RESET => return error.ConnectionResetByPeer,
12795 else => |status| return windows.unexpectedStatus(status),12797 else => |status| return windows.unexpectedStatus(status),
12796 }12798 }
12797}12799}
...@@ -13301,6 +13303,7 @@ fn netWriteWindows(...@@ -13301,6 +13303,7 @@ fn netWriteWindows(
13301 .SUCCESS => return iosb.Information,13303 .SUCCESS => return iosb.Information,
13302 .CANCELLED => unreachable,13304 .CANCELLED => unreachable,
13303 .INSUFFICIENT_RESOURCES => return error.SystemResources,13305 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13306 .CONNECTION_RESET => return error.ConnectionResetByPeer,
13304 else => |status| return windows.unexpectedStatus(status),13307 else => |status| return windows.unexpectedStatus(status),
13305 }13308 }
13306}13309}