[enet-cvs] CVS: enet protocol.c,1.34,1.35

Lee Salzman enet at sferik.cubik.org
Mon Jan 5 18:01:59 PST 2004


Update of /home/enet/cvsroot/enet
In directory sferik:/tmp/cvs-serv19530

Modified Files:
	protocol.c 
Log Message:
bug fix


Index: protocol.c
===================================================================
RCS file: /home/enet/cvsroot/enet/protocol.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- protocol.c	2004/01/01 02:55:45	1.34
+++ protocol.c	2004/01/06 02:01:56	1.35
@@ -160,13 +160,19 @@
          currentPeer < & host -> peers [host -> peerCount];
          ++ currentPeer)
     {
-        if (currentPeer -> state == ENET_PEER_STATE_DISCONNECTED)
-          break;
-
-        if (currentPeer -> address.host == host -> receivedAddress.host &&
+        if (currentPeer -> state != ENET_PEER_STATE_DISCONNECTED &&
+            currentPeer -> address.host == host -> receivedAddress.host &&
             currentPeer -> address.port == host -> receivedAddress.port &&
             currentPeer -> challenge == header -> challenge)
           return NULL;
+    }
+
+    for (currentPeer = host -> peers;
+         currentPeer < & host -> peers [host -> peerCount];
+         ++ currentPeer)
+    {
+        if (currentPeer -> state == ENET_PEER_STATE_DISCONNECTED)
+          break;
     }
 
     if (currentPeer >= & host -> peers [host -> peerCount])



More information about the enet-cvs mailing list