zig

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

commit 23bcb8148fb12d86b003708b6410d98a986d2d9f (tree)
parent fb9ba5e4b315e76c3ff1d01ebd56c651e13c314d
Author: Jonathan Marler <johnnymarler@gmail.com>
Date:   Wed, 22 Apr 2026 10:35:05 -0600

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.


Diffstat:
Mlib/std/Io/Threaded.zig | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig @@ -12255,6 +12255,7 @@ fn netConnectIpWindows( .SUCCESS => {}, .CANCELLED => unreachable, .INSUFFICIENT_RESOURCES => return error.SystemResources, + .CONNECTION_REFUSED => return error.ConnectionRefused, else => |status| return windows.unexpectedStatus(status), } return .{ .handle = socket_handle, .address = bound_address }; @@ -12792,6 +12793,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea .SUCCESS => return iosb.Information, .CANCELLED => unreachable, .INSUFFICIENT_RESOURCES => return error.SystemResources, + .CONNECTION_RESET => return error.ConnectionResetByPeer, else => |status| return windows.unexpectedStatus(status), } } @@ -13301,6 +13303,7 @@ fn netWriteWindows( .SUCCESS => return iosb.Information, .CANCELLED => unreachable, .INSUFFICIENT_RESOURCES => return error.SystemResources, + .CONNECTION_RESET => return error.ConnectionResetByPeer, else => |status| return windows.unexpectedStatus(status), } }