소스 검색

allow loopback connections

Lee Salzman 11 년 전
부모
커밋
d45b44f2b5
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      protocol.c

+ 2 - 1
protocol.c

@@ -297,7 +297,8 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
               peer = currentPeer;
         }
         else 
-        if (currentPeer -> address.host == host -> receivedAddress.host)
+        if (currentPeer -> state != ENET_PEER_STATE_CONNECTING &&
+            currentPeer -> address.host == host -> receivedAddress.host)
         {
             if (currentPeer -> address.port == host -> receivedAddress.port &&
                 currentPeer -> connectID == command -> connect.connectID)