From c9f7ad0e57fe13f671b7775e16e7535d5088eba1 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Fri, 9 Oct 2026 14:10:49 -0600 Subject: [PATCH] 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 --- lib/std/Io/Threaded.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 1cf715279bc42aa65eeed56636798ac020bcdb86..5f7d2621bc6f25b6da5b2a1d579ab4b4bdfdaa16 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -13055,7 +13055,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, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer, + .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer, .IO_TIMEOUT => return error.ConnectionTimedOut, else => |status| return windows.unexpectedStatus(status), } @@ -13569,7 +13569,7 @@ fn netWriteWindows( .SUCCESS => return iosb.Information, .CANCELLED => unreachable, .INSUFFICIENT_RESOURCES => return error.SystemResources, - .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer, + .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer, .IO_TIMEOUT => return error.ConnectionTimedOut, else => |status| return windows.unexpectedStatus(status), } -- 2.54.0