summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-03-01 13:21:16 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-03-01 13:41:42 +0200
commit97a103255e433629f13e2156aa307ca329cdcfc6 (patch)
treebf5de1cef5930647c4ab87a0cff7f88f0007832d /indra/newview/llvoicevivox.cpp
parent92c302d6fba687f0921544b278e22b698d058646 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' (DRTVWR-557) into DRTVWR-546
# Conflicts: # autobuild.xml # doc/contributions.txt # indra/cmake/GLOD.cmake # indra/llcommon/tests/llprocess_test.cpp # indra/newview/VIEWER_VERSION.txt # indra/newview/lldrawpoolavatar.cpp # indra/newview/llfloatermodelpreview.cpp # indra/newview/llmodelpreview.cpp # indra/newview/llviewertexturelist.cpp # indra/newview/llvovolume.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 3d503638e0..19036a3f77 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -89,6 +89,7 @@ namespace {
// Don't retry connecting to the daemon more frequently than this:
const F32 DAEMON_CONNECT_THROTTLE_SECONDS = 1.0f;
+ const int DAEMON_CONNECT_RETRY_MAX = 3;
// Don't send positional updates more frequently than this:
const F32 UPDATE_THROTTLE_SECONDS = 0.5f;
@@ -705,6 +706,11 @@ void LLVivoxVoiceClient::voiceControlCoro()
void LLVivoxVoiceClient::voiceControlStateMachine(S32 &coro_state)
{
+ if (sShuttingDown)
+ {
+ return;
+ }
+
LL_DEBUGS("Voice") << "starting" << LL_ENDL;
mIsCoroutineActive = true;
LLCoros::set_consuming(true);
@@ -860,6 +866,12 @@ void LLVivoxVoiceClient::voiceControlStateMachine(S32 &coro_state)
}
} while (coro_state > 0);
+ if (sShuttingDown)
+ {
+ // LLVivoxVoiceClient might be already dead
+ return;
+ }
+
mIsCoroutineActive = false;
LL_INFOS("Voice") << "exiting" << LL_ENDL;
}
@@ -1033,8 +1045,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
LL_DEBUGS("Voice") << "Connecting to vivox daemon:" << mDaemonHost << LL_ENDL;
+ int retryCount(0);
LLVoiceVivoxStats::getInstance()->reset();
- while (!mConnected && !sShuttingDown)
+ while (!mConnected && !sShuttingDown && retryCount++ <= DAEMON_CONNECT_RETRY_MAX)
{
LLVoiceVivoxStats::getInstance()->connectionAttemptStart();
LL_DEBUGS("Voice") << "Attempting to connect to vivox daemon: " << mDaemonHost << LL_ENDL;
@@ -1160,7 +1173,7 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
{
provisioned = true;
}
- } while (!provisioned && retryCount <= PROVISION_RETRY_MAX && !sShuttingDown);
+ } while (!provisioned && ++retryCount <= PROVISION_RETRY_MAX && !sShuttingDown);
if (sShuttingDown && !provisioned)
{
@@ -1343,6 +1356,12 @@ bool LLVivoxVoiceClient::loginToVivox()
}
LLSD result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, LOGIN_ATTEMPT_TIMEOUT, timeoutResult);
+
+ if (sShuttingDown)
+ {
+ return false;
+ }
+
LL_DEBUGS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL;
if (result.has("login"))
@@ -1405,6 +1424,11 @@ bool LLVivoxVoiceClient::loginToVivox()
} while ((!response_ok || !account_login) && !sShuttingDown);
+ if (sShuttingDown)
+ {
+ return false;
+ }
+
mRelogRequested = false;
mIsLoggedIn = true;
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN);