]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
now prints "Connection refused" if LHNET_Read gets an ECONNREFUSED from inet4 or...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Aug 2003 03:46:52 +0000 (03:46 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Aug 2003 03:46:52 +0000 (03:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3426 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index bdb21c522a12b93ca874ebd27ff57b837e5240cc..d6372548ce3c649d84d8c06414339ace6fe08fdf 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -532,11 +532,23 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
                {
 #ifdef WIN32
                        int e = WSAGetLastError();
-                       if (e == WSAEWOULDBLOCK || e == WSAECONNREFUSED)
+                       if (e == WSAEWOULDBLOCK)
                                return 0;
+                       switch (e)
+                       {
+                               case WSAECONNREFUSED:
+                                       Con_Printf("Connection refused\n");
+                                       return 0;
+                       }
 #else
-                       if (errno == EWOULDBLOCK || errno == ECONNREFUSED)
+                       if (errno == EWOULDBLOCK)
                                return 0;
+                       switch (errno)
+                       {
+                               case ECONNREFUSED:
+                                       Con_Printf("Connection refused\n");
+                                       return 0;
+                       }
 #endif
                }
        }
@@ -555,11 +567,23 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
                {
 #ifdef WIN32
                        int e = WSAGetLastError();
-                       if (e == WSAEWOULDBLOCK || e == WSAECONNREFUSED)
+                       if (e == WSAEWOULDBLOCK)
                                return 0;
+                       switch (e)
+                       {
+                               case WSAECONNREFUSED:
+                                       Con_Printf("Connection refused\n");
+                                       return 0;
+                       }
 #else
-                       if (errno == EWOULDBLOCK || errno == ECONNREFUSED)
+                       if (errno == EWOULDBLOCK)
                                return 0;
+                       switch (errno)
+                       {
+                               case ECONNREFUSED:
+                                       Con_Printf("Connection refused\n");
+                                       return 0;
+                       }
 #endif
                }
        }