Fix crash when trying to send to an unreachable client

https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2232
This commit is contained in:
Alug committed 2024-09-17 20:58:23 +02:00
1 parent 30024f2341
commit f0a8c27829
1 file changed
+5 -1
+5 -1
View File
@@ -100,6 +100,10 @@
#undef ETIMEDOUT
#endif
#define ETIMEDOUT WSAETIMEDOUT
#ifdef EHOSTUNREACH
#undef EHOSTUNREACH
#endif
#define EHOSTUNREACH WSAEHOSTUNREACH
#ifndef IOC_VENDOR
#define IOC_VENDOR 0x18000000
#endif
@@ -853,7 +857,7 @@ static void SOCK_Send(void)
if (c == ERRSOCKET)
{
int e = errno; // save error code so it can't be modified later
if (e != ECONNREFUSED && e != EWOULDBLOCK)
if (e != ECONNREFUSED && e != EWOULDBLOCK && e != EHOSTUNREACH)
I_Error("SOCK_Send, error sending to node %d (%s) #%u: %s", doomcom->remotenode,
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
}