Another fix deciding when to send a signal

The server should never send a signal until the connection is accepted by the
app, under any circumstances.

P4:6865152
This commit is contained in:
Fletcher Dunn
2021-10-29 15:17:39 -07:00
parent d34d8a25cb
commit c2e67175ff
@@ -1275,6 +1275,21 @@ void CSteamNetworkConnectionP2P::ThinkConnection( SteamNetworkingMicroseconds us
if ( !m_pSignaling )
return;
// We can't send our initial signals without certs, etc
if ( GetState() == k_ESteamNetworkingConnectionState_Connecting )
{
if ( !BThinkCryptoReady( usecNow ) )
{
EnsureMinThinkTime( usecNow + k_nMillion/20 );
return;
}
// If we're the server, then don't send any signals until
// the connection is actually accepted.
if ( m_bConnectionInitiatedRemotely )
return;
}
// Time to send a signal?
// Limit using really basic minimum spacing between successive calls
SteamNetworkingMicroseconds usecReliableRTO = GetSignalReliableRTO();
@@ -1286,16 +1301,6 @@ void CSteamNetworkConnectionP2P::ThinkConnection( SteamNetworkingMicroseconds us
return;
}
// We can't send our initial signals without certs, etc
if ( GetState() == k_ESteamNetworkingConnectionState_Connecting )
{
if ( !BThinkCryptoReady( usecNow ) )
{
EnsureMinThinkTime( usecNow + k_nMillion/20 );
return;
}
}
// Check if we should delay sending a signal until
// we collect a bit of initial routing info
SteamNetworkingMicroseconds usecRoutingReady = CheckWaitForInitialRoutingReady( usecNow );