diff options
author | Lee Salzman <[email protected]> | 2020-04-16 00:15:18 -0400 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2020-04-16 00:15:18 -0400 |
commit | c25b57b2c173308c1d6dd37f70d3058e143caf47 (patch) | |
tree | dfb60f25cb9cb522096fdcbc6ad11768fae59006 /peer.c | |
parent | f89e5986d06033f6b6421163444960f78dec99f8 (diff) | |
download | enet-c25b57b2c173308c1d6dd37f70d3058e143caf47.tar.gz enet-c25b57b2c173308c1d6dd37f70d3058e143caf47.zip |
stabilize packet throttle when RTT variance is low
Diffstat (limited to 'peer.c')
-rw-r--r-- | peer.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |