| author | |
| committer | |
| log | f506a49142cdb8454c70acd662bf7e45289ddae2 |
| tree | 053938d50ff51cefe508f314970932d669442314 |
| parent | a72236ae8e9f11f42351ae42b1242f6091216c45 |
4 files changed, 21 insertions(+), 2 deletions(-)
lib/std/Io.zig+13-2| ... | ... | @@ -373,6 +373,9 @@ pub const Operation = union(enum) { |
| 373 | 373 | /// the OS where it was queued up to be reported at the next call |
| 374 | 374 | /// to send or receive on the bound socket. |
| 375 | 375 | PortUnreachable, |
| 376 | /// The remote peer did not respond to ongoing communication, causing the | |
| 377 | /// OS to abort the connection. | |
| 378 | ConnectionTimedOut, | |
| 376 | 379 | } || Io.UnexpectedError; |
| 377 | 380 | |
| 378 | 381 | pub const Result = struct { ?net.Socket.ReceiveError, usize }; |
| ... | ... | @@ -416,6 +419,9 @@ pub const Operation = union(enum) { |
| 416 | 419 | /// An attempt was made to send to a network/broadcast address as |
| 417 | 420 | /// though it was a unicast address. |
| 418 | 421 | AccessDenied, |
| 422 | /// The remote peer did not respond to ongoing communication, causing the | |
| 423 | /// OS to abort the connection. | |
| 424 | ConnectionTimedOut, | |
| 419 | 425 | } || Io.UnexpectedError; |
| 420 | 426 | |
| 421 | 427 | pub const Result = struct { ?net.Socket.SendError, usize }; |
| ... | ... | @@ -429,10 +435,12 @@ pub const Operation = union(enum) { |
| 429 | 435 | SystemResources, |
| 430 | 436 | ConnectionResetByPeer, |
| 431 | 437 | SocketUnconnected, |
| 432 | /// The file descriptor does not hold the required rights to read | |
| 433 | /// from it. | |
| 438 | /// File descriptor does not hold the required rights to read from it. | |
| 434 | 439 | AccessDenied, |
| 435 | 440 | NetworkDown, |
| 441 | /// The remote peer did not respond to ongoing communication, causing the | |
| 442 | /// OS to abort the connection. | |
| 443 | ConnectionTimedOut, | |
| 436 | 444 | } || Io.UnexpectedError; |
| 437 | 445 | |
| 438 | 446 | pub const Result = Error!usize; |
| ... | ... | @@ -469,6 +477,9 @@ pub const Operation = union(enum) { |
| 469 | 477 | /// Local end has been shut down on a connection-oriented socket, or |
| 470 | 478 | /// the socket was never connected. |
| 471 | 479 | SocketUnconnected, |
| 480 | /// The remote peer did not respond to ongoing communication, causing the | |
| 481 | /// OS to abort the connection. | |
| 482 | ConnectionTimedOut, | |
| 472 | 483 | SocketNotBound, |
| 473 | 484 | } || Io.UnexpectedError; |
| 474 | 485 |
lib/std/Io/Threaded.zig+6| ... | ... | @@ -12883,6 +12883,7 @@ fn netReadPosix(fd: net.Socket.Handle, data: [][]u8) net.Stream.Reader.Error!usi |
| 12883 | 12883 | .NOMEM => return error.SystemResources, |
| 12884 | 12884 | .NOTCONN => return error.SocketUnconnected, |
| 12885 | 12885 | .CONNRESET => return error.ConnectionResetByPeer, |
| 12886 | .TIMEDOUT => return error.ConnectionTimedOut, | |
| 12886 | 12887 | .NOTCAPABLE => return error.AccessDenied, |
| 12887 | 12888 | else => |err| return posix.unexpectedErrno(err), |
| 12888 | 12889 | } |
| ... | ... | @@ -12914,6 +12915,7 @@ fn netReadPosix(fd: net.Socket.Handle, data: [][]u8) net.Stream.Reader.Error!usi |
| 12914 | 12915 | .NOMEM => return error.SystemResources, |
| 12915 | 12916 | .NOTCONN => return error.SocketUnconnected, |
| 12916 | 12917 | .CONNRESET => return error.ConnectionResetByPeer, |
| 12918 | .TIMEDOUT => return error.ConnectionTimedOut, | |
| 12917 | 12919 | .PIPE => return error.SocketUnconnected, |
| 12918 | 12920 | .NETDOWN => return error.NetworkDown, |
| 12919 | 12921 | else => |err| return posix.unexpectedErrno(err), |
| ... | ... | @@ -13077,6 +13079,7 @@ fn netSendOnePosix( |
| 13077 | 13079 | .HOSTUNREACH => return syscall.fail(error.HostUnreachable), |
| 13078 | 13080 | .NETUNREACH => return syscall.fail(error.NetworkUnreachable), |
| 13079 | 13081 | .NOTCONN => return syscall.fail(error.SocketUnconnected), |
| 13082 | .TIMEDOUT => return syscall.fail(error.ConnectionTimedOut), | |
| 13080 | 13083 | .NETDOWN => return syscall.fail(error.NetworkDown), |
| 13081 | 13084 | .BADF => |err| return syscall.errnoBug(err), // File descriptor used after closed. |
| 13082 | 13085 | .DESTADDRREQ => |err| return syscall.errnoBug(err), |
| ... | ... | @@ -13148,6 +13151,7 @@ fn netSendManyPosix( |
| 13148 | 13151 | .HOSTUNREACH => return syscall.fail(error.HostUnreachable), |
| 13149 | 13152 | .NETUNREACH => return syscall.fail(error.NetworkUnreachable), |
| 13150 | 13153 | .NOTCONN => return syscall.fail(error.SocketUnconnected), |
| 13154 | .TIMEDOUT => return syscall.fail(error.ConnectionTimedOut), | |
| 13151 | 13155 | .NETDOWN => return syscall.fail(error.NetworkDown), |
| 13152 | 13156 | |
| 13153 | 13157 | .BADF => |err| return syscall.errnoBug(err), // File descriptor used after closed. |
| ... | ... | @@ -13228,6 +13232,7 @@ fn netReceivePosix( |
| 13228 | 13232 | .MSGSIZE => return syscall.fail(error.MessageOversize), |
| 13229 | 13233 | .PIPE => return syscall.fail(error.SocketUnconnected), |
| 13230 | 13234 | .CONNRESET => return syscall.fail(error.ConnectionResetByPeer), |
| 13235 | .TIMEDOUT => return syscall.fail(error.ConnectionTimedOut), | |
| 13231 | 13236 | .NETDOWN => return syscall.fail(error.NetworkDown), |
| 13232 | 13237 | .AGAIN => return syscall.fail(error.WouldBlock), |
| 13233 | 13238 | .BADF => |err| return syscall.errnoBug(err), |
| ... | ... | @@ -13390,6 +13395,7 @@ fn netWritePosix( |
| 13390 | 13395 | .HOSTUNREACH => return error.HostUnreachable, |
| 13391 | 13396 | .NETUNREACH => return error.NetworkUnreachable, |
| 13392 | 13397 | .NOTCONN => return error.SocketUnconnected, |
| 13398 | .TIMEDOUT => return error.ConnectionTimedOut, | |
| 13393 | 13399 | .NETDOWN => return error.NetworkDown, |
| 13394 | 13400 | else => |err| return posix.unexpectedErrno(err), |
| 13395 | 13401 | } |
lib/std/Io/Uring.zig+1| ... | ... | @@ -5152,6 +5152,7 @@ fn netReceive( |
| 5152 | 5152 | .PIPE => return .{ error.SocketUnconnected, message_i }, |
| 5153 | 5153 | .OPNOTSUPP => |err| return .{ errnoBug(err), message_i }, |
| 5154 | 5154 | .CONNRESET => return .{ error.ConnectionResetByPeer, message_i }, |
| 5155 | .TIMEDOUT => return .{ error.ConnectionTimedOut, message_i }, | |
| 5155 | 5156 | .NETDOWN => return .{ error.NetworkDown, message_i }, |
| 5156 | 5157 | else => |err| return .{ unexpectedErrno(err), message_i }, |
| 5157 | 5158 | } |
src/IncrementalDebugServer.zig+1| ... | ... | @@ -95,6 +95,7 @@ fn runServer(ids: *IncrementalDebugServer) void { |
| 95 | 95 | => |e| log.err("failed to serve '{f}' ({t})", .{ stream.socket.address, e }), |
| 96 | 96 | |
| 97 | 97 | error.EndOfStream, |
| 98 | error.ConnectionTimedOut, | |
| 98 | 99 | error.ConnectionResetByPeer, |
| 99 | 100 | => log.info("client '{f}' disconnected", .{stream.socket.address}), |
| 100 | 101 |