Tier2: only enforce retry timer on (state == CS_RETRY)

Fixes a bug where the initial connect is only initiated after lastQueryTime + params.retryTime seconds.
This commit is contained in:
Kawe Mazidjatari 2024-03-30 02:57:59 +01:00
parent e02f8f36fe
commit e48c9f58ba

View File

@ -208,11 +208,14 @@ bool CWebSocket::IsInitialized() const
//-----------------------------------------------------------------------------
bool CWebSocket::ConnContext_s::Connect(const double queryTime, const ConnParams_s& params)
{
if (state == CS_RETRY)
{
const double retryTimeTotal = lastQueryTime + params.retryTime;
const double currTime = Plat_FloatTime();
if (retryTimeTotal > currTime)
return false; // Still within retry period
}
tryCount++;
webSocket = ProtoWebSocketCreate(params.bufSize);