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 20:00:54+02:00
log9276a56e3cee12a067f93d719a5e7f2762dd4603
tree403a06f3fc86a5d820b8f448a02899caa90cf30a
parent9449bac4226b659abe7ab190cc5603d47086b53c

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
......@@ -13079,7 +13079,7 @@ fn netReadWindows(socket_handle: net.Socket.Handle, data: [][]u8) net.Stream.Rea
1307913079 .SUCCESS => return iosb.Information,
1308013080 .CANCELLED => unreachable,
1308113081 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13082 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,
13082 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
1308313083 .IO_TIMEOUT => return error.ConnectionTimedOut,
1308413084 else => |status| return windows.unexpectedStatus(status),
1308513085 }
......@@ -13593,7 +13593,7 @@ fn netWriteWindows(
1359313593 .SUCCESS => return iosb.Information,
1359413594 .CANCELLED => unreachable,
1359513595 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13596 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,
13596 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
1359713597 .IO_TIMEOUT => return error.ConnectionTimedOut,
1359813598 else => |status| return windows.unexpectedStatus(status),
1359913599 }