<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">[PATCH] Fix error reporting in NET_GetPacket

strerror won't work here, so just return the integer value. At least
we can look that up. Also, I have experienced a couple of instances of
connection reset problems, so I added a check for that.

diff -urN a/QW/common/net_wins.c head/QW/common/net_wins.c
--- a/QW/common/net_wins.c	2006-02-14 17:23:00.000000000 +1030
+++ head/QW/common/net_wins.c	2006-02-19 09:48:41.000000000 +1030
@@ -190,12 +190,19 @@
 
 	if (err == WSAEWOULDBLOCK)
 	    return false;
+	if (err == WSAECONNRESET) {
+	    /* This has happened to me a few times, but I don't know how to
+	       reproduce it yet... */
+	    Con_DPrintf("Warning: Connection reset by peer %s in %s\n",
+			NET_AdrToString(net_from), __func__);
+	    return false;
+	}
 	if (err == WSAEMSGSIZE) {
 	    Con_Printf("Warning:  Oversize packet from %s\n",
 		       NET_AdrToString(net_from));
 	    return false;
 	}
-	Sys_Error("%s: %s", __func__, strerror(err));
+	Sys_Error("%s: WSAGetLastError == %i", __func__, err);
     }
 
     net_message.cursize = ret;
</pre></body></html>