From 9276a56e3cee12a067f93d719a5e7f2762dd4603 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 f719bb02a336382a0a8843db52c4ca3fd3406ddf..ea3875c8c91ed62cbb98d1c44a6daf909c91c846 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -13079,7 +13079,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), } @@ -13593,7 +13593,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