commit 2c79d669a7ad802c795583cf66bca1fffc8ce23e (tree)
parent 70c608add8b6112a38144b8aa40b351632220fa3
Author: Bill Nagel <bill@axzez.com>
Date: Tue, 12 Jan 2021 14:53:58 -0500
add missing ECONNRESET from getsockoptError
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/std/os.zig b/lib/std/os.zig
@@ -3146,6 +3146,9 @@ pub const ConnectError = error{
/// The given path for the unix socket does not exist.
FileNotFound,
+
+ /// Connection was reset by peer before connect could complete.
+ ConnectionResetByPeer,
} || UnexpectedError;
/// Initiate a connection on a socket.
@@ -3223,6 +3226,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void {
ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
EPROTOTYPE => unreachable, // The socket type does not support the requested communications protocol.
ETIMEDOUT => return error.ConnectionTimedOut,
+ ECONNRESET => return error.ConnectionResetByPeer,
else => |err| return unexpectedErrno(err),
},
EBADF => unreachable, // The argument sockfd is not a valid file descriptor.