mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
Fix bug in expiry of in-flight packets.
This meant the map was growing without bound! The worse the packet loss, the worse the growth of this map. This didn't break the wire protocol, it was just bad for perf. But not that bad, because the data structure has a good O() time and all of the old packets that should have been expired were just not really examined. Until I added code to check it constantly. Then I noticed perf has tanked! I am actually surprised that static analysis didn't catch this.
This commit is contained in:
@@ -1206,10 +1206,9 @@ SteamNetworkingMicroseconds CSteamNetworkConnectionBase::SNP_SenderCheckInFlight
|
||||
++inFlightPkt;
|
||||
|
||||
// Expire old packets (all of these should have been marked as nacked)
|
||||
SteamNetworkingMicroseconds usecNackExpiry = usecRTO*2;
|
||||
SteamNetworkingMicroseconds usecWhenExpiry = usecNow - usecRTO*2;
|
||||
for (;;)
|
||||
{
|
||||
SteamNetworkingMicroseconds usecWhenExpiry = inFlightPkt->second.m_usecWhenSent - usecNackExpiry;
|
||||
if ( inFlightPkt->second.m_usecWhenSent > usecWhenExpiry )
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user