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
1305513055 .SUCCESS => return iosb.Information,
1305613056 .CANCELLED => unreachable,
1305713057 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13058 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,
13058 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
1305913059 .IO_TIMEOUT => return error.ConnectionTimedOut,
1306013060 else => |status| return windows.unexpectedStatus(status),
1306113061 }
......@@ -13569,7 +13569,7 @@ fn netWriteWindows(
1356913569 .SUCCESS => return iosb.Information,
1357013570 .CANCELLED => unreachable,
1357113571 .INSUFFICIENT_RESOURCES => return error.SystemResources,
13572 .CONNECTION_RESET, .REMOTE_DISCONNECT => return error.ConnectionResetByPeer,
13572 .CONNECTION_RESET, .REMOTE_DISCONNECT, .LOCAL_DISCONNECT => return error.ConnectionResetByPeer,
1357313573 .IO_TIMEOUT => return error.ConnectionTimedOut,
1357413574 else => |status| return windows.unexpectedStatus(status),
1357513575 }