summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmitrykproductengine <none@none>2013-09-25 12:58:16 +0300
committerdmitrykproductengine <none@none>2013-09-25 12:58:16 +0300
commit2e5e03b73a5bc581097c9b5828537796568aa2e3 (patch)
tree746e09c66d4b5b365b199bc9bb09848d3c5b1909
parent64c5afa196d1692cd0823ccd555f1f7bb32f529d (diff)
MAINT-3169 FIXED
[Improvement] Prevent latest Voice service from connecting or error popup from occurring when Voice Chat setting is disabled in the viewer.
-rwxr-xr-xindra/newview/llvoicevivox.cpp11
-rwxr-xr-xindra/newview/llvoicevivox.h2
2 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 9497041482..050d9dd785 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -261,6 +261,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mSessionTerminateRequested(false),
mRelogRequested(false),
mConnected(false),
+ mTerminateDaemon(false),
mPump(NULL),
mSpatialJoiningNum(0),
@@ -695,7 +696,7 @@ void LLVivoxVoiceClient::stateMachine()
setVoiceEnabled(false);
}
- if(mVoiceEnabled || !mIsInitialized)
+ if(mVoiceEnabled || (!mIsInitialized &&!mTerminateDaemon) )
{
updatePosition();
}
@@ -708,11 +709,12 @@ void LLVivoxVoiceClient::stateMachine()
if((getState() != stateDisabled) && (getState() != stateDisableCleanup))
{
// User turned off voice support. Send the cleanup messages, close the socket, and reset.
- if(!mConnected)
+ if(!mConnected || mTerminateDaemon)
{
// if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill.
LL_INFOS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL;
killGateway();
+ mTerminateDaemon = false;
}
logout();
@@ -753,7 +755,7 @@ void LLVivoxVoiceClient::stateMachine()
// Voice is locked out, we must not launch the vivox daemon.
setState(stateJail);
}
- else if(!isGatewayRunning())
+ else if(!isGatewayRunning() && gSavedSettings.getBOOL("EnableVoiceChat"))
{
if (true) // production build, not test
{
@@ -1136,6 +1138,7 @@ void LLVivoxVoiceClient::stateMachine()
std::stringstream errs;
errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
args["HOSTID"] = errs.str();
+ mTerminateDaemon = true;
if (LLGridManager::getInstance()->isSystemGrid())
{
LLNotificationsUtil::add("NoVoiceConnect", args);
@@ -2618,6 +2621,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
std::stringstream errs;
errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
args["HOSTID"] = errs.str();
+ mTerminateDaemon = true;
if (LLGridManager::getInstance()->isSystemGrid())
{
LLNotificationsUtil::add("NoVoiceConnect", args);
@@ -2633,6 +2637,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL;
mVoiceVersion.serverVersion = versionID;
mConnectorHandle = connectorHandle;
+ mTerminateDaemon = false;
if(getState() == stateConnectorStarting)
{
setState(stateConnectorStarted);
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index e2d1585c15..c325d72ba6 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -659,6 +659,8 @@ private:
LLSocket::ptr_t mSocket;
bool mConnected;
+ // We should kill the voice daemon in case of connection alert
+ bool mTerminateDaemon;
LLPumpIO *mPump;
friend class LLVivoxProtocolParser;