diff --git a/source/net_mp.c b/source/net_mp.c index 85273f4..868e3a9 100644 --- a/source/net_mp.c +++ b/source/net_mp.c @@ -262,7 +262,7 @@ int MPATH_CheckNewConnections (void) if (net_acceptsocket == -1) return -1; - if (recvfrom (net_acceptsocket, buf, 4, MSG_PEEK, NULL, NULL) > 0) + if (recvfrom (net_acceptsocket, buf, 4, MSG_PEEK, NULL, NULL) >= 0) return net_acceptsocket; return -1; } diff --git a/source/net_udp.c b/source/net_udp.c index 86b04ee..e565ce4 100644 --- a/source/net_udp.c +++ b/source/net_udp.c @@ -248,6 +248,9 @@ int UDP_Connect (int socket, struct qsockaddr *addr) int UDP_CheckNewConnections (void) { unsigned long available; + struct sockaddr_in from; + socklen_t fromlen; + char buff[1]; if (net_acceptsocket == -1) return -1; @@ -256,6 +259,7 @@ int UDP_CheckNewConnections (void) Sys_Error ("UDP: ioctlsocket (FIONREAD) failed\n"); if (available) return net_acceptsocket; + recvfrom (net_acceptsocket, buff, 0, 0, &from, &fromlen); return -1; } diff --git a/source/net_wins.c b/source/net_wins.c index ecd249d..3e189df 100644 --- a/source/net_wins.c +++ b/source/net_wins.c @@ -393,7 +393,7 @@ int WINS_CheckNewConnections (void) if (net_acceptsocket == -1) return -1; - if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) > 0) + if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) >= 0) { return net_acceptsocket; }