From 57bb5e87bcc41400b49ec645ce8eb4b00f2c2c34 Mon Sep 17 00:00:00 2001 From: eihrul Date: Fri, 13 Jul 2007 03:25:16 +0000 Subject: *** empty log message *** --- protocol.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'protocol.c') diff --git a/protocol.c b/protocol.c index c41ccde..b8930c2 100644 --- a/protocol.c +++ b/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) * -- cgit v1.2.3