summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2007-07-13 03:25:16 +0000
committereihrul <eihrul>2007-07-13 03:25:16 +0000
commit57bb5e87bcc41400b49ec645ce8eb4b00f2c2c34 (patch)
treeb1ef5bc0adebdf64adc64192ea13b58832908898
parent18df9486dcd1aa62ca0b3b0b342f0563930171a2 (diff)
downloadenet-57bb5e87bcc41400b49ec645ce8eb4b00f2c2c34.tar.gz
enet-57bb5e87bcc41400b49ec645ce8eb4b00f2c2c34.zip
*** empty log message ***
-rw-r--r--protocol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/protocol.c b/protocol.c
index c41ccde..b8930c2 100644
--- a/protocol.c
+++ b/protocol.c
@@ -302,6 +302,12 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
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) *
ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;