aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--peer.c2
-rw-r--r--protocol.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/peer.c b/peer.c
index ca93289..56a285f 100644
--- a/peer.c
+++ b/peer.c
@@ -66,7 +66,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt)
peer -> packetThrottle = peer -> packetThrottleLimit;
}
else
- if (rtt <= peer -> lastRoundTripTime)
+ if (rtt <= peer -> lastRoundTripTime + (peer -> lastRoundTripTimeVariance + 1) / 2)
{
peer -> packetThrottle += peer -> packetThrottleAcceleration;
diff --git a/protocol.c b/protocol.c
index 906f57d..2b35e3e 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, (peer -> lowestRoundTripTime + 23) / 24);
+ peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, (peer -> lowestRoundTripTime + 15) / 16);
peer -> lowestRoundTripTime = peer -> roundTripTime;
peer -> highestRoundTripTimeVariance = peer -> roundTripTimeVariance;
peer -> packetThrottleEpoch = host -> serviceTime;