diff options
author | eihrul <eihrul> | 2010-12-20 10:46:57 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2010-12-20 10:46:57 +0000 |
commit | 1e18fd60019c1d6e8bc0812291c9739aa333c26b (patch) | |
tree | 77a77613f716071cc97681139f95c27a7ca6063a | |
parent | 2a878c23727a4ba36950f321715e830d1c1bf365 (diff) | |
download | enet-1e18fd60019c1d6e8bc0812291c9739aa333c26b.tar.gz enet-1e18fd60019c1d6e8bc0812291c9739aa333c26b.zip |
reliable packet throttle tweak
-rw-r--r-- | protocol.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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)) |