stabilize packet throttle when RTT variance is low

This commit is contained in:
Lee Salzman
2020-04-16 00:15:18 -04:00
parent f89e5986d0
commit c25b57b2c1
3 changed files with 10 additions and 38 deletions
+2 -2
View File
@@ -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 -> packetThrottle += peer -> packetThrottleAcceleration;
@@ -76,7 +76,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt)
return 1;
}
else
if (rtt > peer -> lastRoundTripTime + 2 * peer -> lastRoundTripTimeVariance)
if (rtt >= peer -> lastRoundTripTime + 2 * peer -> lastRoundTripTimeVariance)
{
if (peer -> packetThrottle > peer -> packetThrottleDeceleration)
peer -> packetThrottle -= peer -> packetThrottleDeceleration;