aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2020-07-24 01:50:34 -0400
committerLee Salzman <[email protected]>2020-07-24 01:50:34 -0400
commiteda26a26d913a1e86f44fae725049c97dc1ce5a8 (patch)
treee75381548ef79e7b71b2f18d7084d1b23c848604
parent4f3dbbaeb19a54a09cd4a984c8c5107436a2b197 (diff)
downloadenet-eda26a26d913a1e86f44fae725049c97dc1ce5a8.tar.gz
enet-eda26a26d913a1e86f44fae725049c97dc1ce5a8.zip
clamp throttle variance from below based on RTT percentage
-rw-r--r--protocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/protocol.c b/protocol.c
index 350337d..051673d 100644
--- a/protocol.c
+++ b/protocol.c
@@ -888,7 +888,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer *
ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> packetThrottleEpoch) >= peer -> packetThrottleInterval)
{
peer -> lastRoundTripTime = peer -> lowestRoundTripTime;
- peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, 2);
+ peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, (peer -> lowestRoundTripTime + 31) / 32);
peer -> lowestRoundTripTime = peer -> roundTripTime;
peer -> highestRoundTripTimeVariance = peer -> roundTripTimeVariance;
peer -> packetThrottleEpoch = host -> serviceTime;