From e650069a4461db97b449797be0f300ecf5cad549 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 3 May 2019 14:50:54 +0300 Subject: SL-11058 Better delay logic --- indra/newview/llvoicevivox.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 2584f4b9a4..ae4b065333 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -658,6 +658,8 @@ void LLVivoxVoiceClient::voiceControlCoro() mIsCoroutineActive = true; LLCoros::set_consuming(true); + U32 retry = 0; + while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_DEBUGS("Voice") << "Suspending voiceControlCoro() momentarily for teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL; @@ -678,6 +680,7 @@ void LLVivoxVoiceClient::voiceControlCoro() LL_DEBUGS("Voice") << "lost channel RelogRequested=" << mRelogRequested << LL_ENDL; endAndDisconnectSession(); + retry = 0; } // if we hit this and mRelogRequested is true, that indicates @@ -693,10 +696,16 @@ void LLVivoxVoiceClient::voiceControlCoro() if (!success) { // We failed to connect, give it a bit time before retrying. - llcoro::suspendUntilTimeout(5.0); + retry++; + F32 delay = llmin(5.f * (F32)retry, 60.f); + llcoro::suspendUntilTimeout(delay); + LL_INFOS("Voice") << "Voice failed to establish session after " << retry << " tries. Will attempt to reconnect." << LL_ENDL; + } + else + { + LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; } - LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_INFOS("Voice") << "waiting for SLVoice to exit" << LL_ENDL; -- cgit v1.2.3