From 25528671d2ecb54ee4c8ec404018fcfc7a5dbb3b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 2 Nov 2019 21:28:05 -0700 Subject: [PATCH] Fix error value on control stream and RTSP handshake failure --- src/ControlStream.c | 2 +- src/PlatformSockets.c | 2 +- src/PlatformSockets.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ControlStream.c b/src/ControlStream.c index c8ab6c9..a30edb4 100644 --- a/src/ControlStream.c +++ b/src/ControlStream.c @@ -818,7 +818,7 @@ int startControlStream(void) { peer = NULL; enet_host_destroy(client); client = NULL; - return -1; + return ETIMEDOUT; } // Ensure the connect verify ACK is sent immediately diff --git a/src/PlatformSockets.c b/src/PlatformSockets.c index 4079e1b..4987163 100644 --- a/src/PlatformSockets.c +++ b/src/PlatformSockets.c @@ -243,7 +243,7 @@ SOCKET connectTcpSocket(struct sockaddr_storage* dstaddr, SOCKADDR_LEN addrlen, // select() timed out Limelog("select() timed out after %d seconds\n", timeoutSec); closeSocket(s); - SetLastSocketError(EWOULDBLOCK); + SetLastSocketError(ETIMEDOUT); return INVALID_SOCKET; } else if (FD_ISSET(s, &writefds) || FD_ISSET(s, &exceptfds)) { diff --git a/src/PlatformSockets.h b/src/PlatformSockets.h index f10fc08..063c31f 100644 --- a/src/PlatformSockets.h +++ b/src/PlatformSockets.h @@ -13,6 +13,7 @@ #define EWOULDBLOCK WSAEWOULDBLOCK #define EAGAIN WSAEWOULDBLOCK #define EINTR WSAEINTR +#define ETIMEDOUT WSAETIMEDOUT typedef int SOCK_RET; typedef int SOCKADDR_LEN;