Forráskód Böngészése

*** empty log message ***

eihrul 17 éve
szülő
commit
57bb5e87bc
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      protocol.c

+ 6 - 0
protocol.c

@@ -301,6 +301,12 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
     if (host -> outgoingBandwidth == 0 &&
         currentPeer -> incomingBandwidth == 0)
       currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
+    else
+    if (host -> outgoingBandwidth == 0 ||
+        currentPeer -> incomingBandwidth == 0)
+      currentPeer -> windowSize = (ENET_MAX (host -> outgoingBandwidth, currentPeer -> incomingBandwidth) /
+                                    ENET_PEER_WINDOW_SIZE_SCALE) *
+                                      ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
     else
       currentPeer -> windowSize = (ENET_MIN (host -> outgoingBandwidth, currentPeer -> incomingBandwidth) /
                                     ENET_PEER_WINDOW_SIZE_SCALE) *