authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2026-10-09 14:10:49-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-10-10 11:20:16-07:00
logc9f7ad0e57fe13f671b7775e16e7535d5088eba1
treeddfb2dc5c6c402b2fdb525b36db632dde8a9fdc7
parent608024720688c268a8b5fdb06665b7ce66293ba1

std.Io.Threaded: map LOCAL_DISCONNECT to ConnectionResetByPeer on Windows

netReadWindows and netWriteWindows returned error.Unexpected when AFD reported STATUS_LOCAL_DISCONNECT. I was able to produce this error in both the read and write paths locally. Partial fix of #31956

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

lib/std/Io/Threaded.zig+2-2
...@@ -13055,7 +13055,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea...@@ -13055,7 +13055,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea
13055 .SUCCESS => return iosb.Information,13055 .SUCCESS => return iosb.Information,
13056 .CANCELLED => unreachable,13056 .CANCELLED => unreachable,
13057 .INSUFFICIENT_RESOURCES => return error.SystemResources,13057 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13058 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,13058 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
13059 .IO_TIMEOUT => return error.ConnectionTimedOut,13059 .IO_TIMEOUT => return error.ConnectionTimedOut,
13060 else => |status| return windows.unexpectedStatus(status),13060 else => |status| return windows.unexpectedStatus(status),
13061 }13061 }
...@@ -13569,7 +13569,7 @@ fn netWriteWindows(...@@ -13569,7 +13569,7 @@ fn netWriteWindows(
13569 .SUCCESS => return iosb.Information,13569 .SUCCESS => return iosb.Information,
13570 .CANCELLED => unreachable,13570 .CANCELLED => unreachable,
13571 .INSUFFICIENT_RESOURCES => return error.SystemResources,13571 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13572 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,13572 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
13573 .IO_TIMEOUT => return error.ConnectionTimedOut,13573 .IO_TIMEOUT => return error.ConnectionTimedOut,
13574 else => |status| return windows.unexpectedStatus(status),13574 else => |status| return windows.unexpectedStatus(status),
13575 }13575 }