authorgravatar for bill@axzez.comBill Nagel <bill@axzez.com> 2021-01-12 14:53:58-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-12 18:11:58-08:00
log2c79d669a7ad802c795583cf66bca1fffc8ce23e
treef5b4e91ab74263b71c6c15148d75542364eb27c4
parent70c608add8b6112a38144b8aa40b351632220fa3

add missing ECONNRESET from getsockoptError


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/os.zig+4
...@@ -3146,6 +3146,9 @@ pub const ConnectError = error{...@@ -3146,6 +3146,9 @@ pub const ConnectError = error{
31463146
3147 /// The given path for the unix socket does not exist.3147 /// The given path for the unix socket does not exist.
3148 FileNotFound,3148 FileNotFound,
3149
3150 /// Connection was reset by peer before connect could complete.
3151 ConnectionResetByPeer,
3149} || UnexpectedError;3152} || UnexpectedError;
31503153
3151/// Initiate a connection on a socket.3154/// Initiate a connection on a socket.
...@@ -3223,6 +3226,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void {...@@ -3223,6 +3226,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void {
3223 ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.3226 ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
3224 EPROTOTYPE => unreachable, // The socket type does not support the requested communications protocol.3227 EPROTOTYPE => unreachable, // The socket type does not support the requested communications protocol.
3225 ETIMEDOUT => return error.ConnectionTimedOut,3228 ETIMEDOUT => return error.ConnectionTimedOut,
3229 ECONNRESET => return error.ConnectionResetByPeer,
3226 else => |err| return unexpectedErrno(err),3230 else => |err| return unexpectedErrno(err),
3227 },3231 },
3228 EBADF => unreachable, // The argument sockfd is not a valid file descriptor.3232 EBADF => unreachable, // The argument sockfd is not a valid file descriptor.