]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Turn off RFC 1149 on systems that have it enabled.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Apr 2012 09:36:28 +0000 (09:36 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Apr 2012 09:36:28 +0000 (09:36 +0000)
We got massive reports of lags on systems supporting this protocol.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11775 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index c07866adaaf31cc039f58aac2179914fea24d956..fc1acf2b056724cc983cc8bbbb4be46bd332fd1c 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -945,6 +945,20 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address)
                                                        lhnetaddressnative_t *localaddress = (lhnetaddressnative_t *)&lhnetsocket->address;
                                                        SOCKLEN_T namelen;
                                                        int bindresult;
                                                        lhnetaddressnative_t *localaddress = (lhnetaddressnative_t *)&lhnetsocket->address;
                                                        SOCKLEN_T namelen;
                                                        int bindresult;
+
+#if defined(SOL_RFC1149) && defined(RFC1149_1149ONLY)
+                                                       // we got reports of massive lags when this protocol was chosen as transport
+                                                       // so better turn it off
+                                                       {
+                                                               int rfc1149only = 0;
+                                                               int rfc1149enabled = 0;
+                                                               if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_1149ONLY, &rfc1149only))
+                                                                       Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
+                                                               if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_ENABLED, &rfc1149enabled))
+                                                                       Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
+                                                       }
+#endif
+
 #ifdef SUPPORTIPV6
                                                        if (address->addresstype == LHNETADDRESSTYPE_INET6)
                                                        {
 #ifdef SUPPORTIPV6
                                                        if (address->addresstype == LHNETADDRESSTYPE_INET6)
                                                        {