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(
1225512255 .SUCCESS => {},
1225612256 .CANCELLED => unreachable,
1225712257 .INSUFFICIENT_RESOURCES => return error.SystemResources,
12258 .CONNECTION_REFUSED => return error.ConnectionRefused,
1225812259 else => |status| return windows.unexpectedStatus(status),
1225912260 }
1226012261 return .{ .handle = socket_handle, .address = bound_address };
......@@ -12792,6 +12793,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea
1279212793 .SUCCESS => return iosb.Information,
1279312794 .CANCELLED => unreachable,
1279412795 .INSUFFICIENT_RESOURCES => return error.SystemResources,
12796 .CONNECTION_RESET => return error.ConnectionResetByPeer,
1279512797 else => |status| return windows.unexpectedStatus(status),
1279612798 }
1279712799}
......@@ -13301,6 +13303,7 @@ fn netWriteWindows(
1330113303 .SUCCESS => return iosb.Information,
1330213304 .CANCELLED => unreachable,
1330313305 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13306 .CONNECTION_RESET => return error.ConnectionResetByPeer,
1330413307 else => |status| return windows.unexpectedStatus(status),
1330513308 }
1330613309}