Browse Source

net: add ECONNRESET to the error handling of recv

Laytan 4 months ago
parent
commit
11da543f26
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/net/errors_linux.odin

+ 2 - 2
core/net/errors_linux.odin

@@ -159,7 +159,7 @@ _tcp_recv_error :: proc(errno: linux.Errno) -> TCP_Recv_Error {
 		return .Invalid_Argument
 		return .Invalid_Argument
 	case .ENOTCONN:
 	case .ENOTCONN:
 		return .Not_Connected
 		return .Not_Connected
-	case .ECONNREFUSED:
+	case .ECONNREFUSED, .ECONNRESET:
 		return .Connection_Closed
 		return .Connection_Closed
 	case .ETIMEDOUT:
 	case .ETIMEDOUT:
 		return .Timeout
 		return .Timeout
@@ -179,7 +179,7 @@ _udp_recv_error :: proc(errno: linux.Errno) -> UDP_Recv_Error {
 	#partial switch errno {
 	#partial switch errno {
 	case .EBADF, .ENOTSOCK, .EFAULT:
 	case .EBADF, .ENOTSOCK, .EFAULT:
 		return .Invalid_Argument
 		return .Invalid_Argument
-	case .ECONNREFUSED, .ENOTCONN:
+	case .ECONNREFUSED, .ENOTCONN, .ECONNRESET:
 		return .Connection_Refused
 		return .Connection_Refused
 	case .ETIMEDOUT:
 	case .ETIMEDOUT:
 		return .Timeout
 		return .Timeout