From 1e18fd60019c1d6e8bc0812291c9739aa333c26b Mon Sep 17 00:00:00 2001 From: eihrul Date: Mon, 20 Dec 2010 10:46:57 +0000 Subject: reliable packet throttle tweak --- protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'protocol.c') diff --git a/protocol.c b/protocol.c index 8e26dfb..f9b2b09 100644 --- a/protocol.c +++ b/protocol.c @@ -1291,7 +1291,9 @@ enet_protocol_send_reliable_outgoing_commands (ENetHost * host, ENetPeer * peer) if (outgoingCommand -> packet != NULL) { - if (peer -> reliableDataInTransit + outgoingCommand -> fragmentLength > peer -> windowSize) + enet_uint32 windowSize = (peer -> packetThrottle * peer -> windowSize) / ENET_PEER_PACKET_THROTTLE_SCALE; + + if (peer -> reliableDataInTransit + outgoingCommand -> fragmentLength > ENET_MAX (windowSize, peer -> mtu)) break; if ((enet_uint16) (peer -> mtu - host -> packetSize) < (enet_uint16) (commandSize + outgoingCommand -> fragmentLength)) -- cgit v1.2.3