Skip to content
Snippets Groups Projects
Commit 03593762 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix voice

parent 6d155bca
No related branches found
No related tags found
No related merge requests found
......@@ -947,21 +947,6 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
LLProcess::Params params;
params.executable = exe_path;
// VOICE-88: Cycle through [portbase..portbase+portrange) on
// successive tries because attempting to relaunch (after manually
// disabling and then re-enabling voice) with the same port can
// cause SLVoice's bind() call to fail with EADDRINUSE. We expect
// that eventually the OS will time out previous ports, which is
// why we cycle instead of incrementing indefinitely.
U32 portbase = gSavedSettings.getU32("VivoxVoicePort");
static U32 portoffset = 0;
static const U32 portrange = 100;
std::string host(gSavedSettings.getString("VivoxVoiceHost"));
U32 port = portbase + portoffset;
portoffset = (portoffset + 1) % portrange;
params.args.add("-i");
params.args.add(STRINGIZE(host << ':' << port));
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
if (loglevel.empty())
{
......@@ -970,18 +955,6 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
params.args.add("-ll");
params.args.add(loglevel);
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
{
S32 port_nr = 30000 + ll_rand(20000);
LLControlVariable* voice_port = gSavedSettings.getControl("VivoxVoicePort");
if (voice_port)
{
voice_port->setValue(LLSD(port_nr), false);
params.args.add("-i");
params.args.add(llformat("127.0.0.1:%u", gSavedSettings.getU32("VivoxVoicePort")));
}
}
std::string log_folder = gSavedSettings.getString("VivoxLogDirectory");
if (log_folder.empty())
......@@ -1017,6 +990,18 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
params.args.add("-st");
params.args.add(shutdown_timeout);
}
if (gSavedSettings.getBOOL("VoiceMultiInstance"))
{
S32 port_nr = 30000 + ll_rand(20000);
LLControlVariable* voice_port = gSavedSettings.getControl("VivoxVoicePort");
if (voice_port)
{
voice_port->setValue(LLSD(port_nr), false);
params.args.add("-i");
params.args.add(llformat("127.0.0.1:%u", gSavedSettings.getU32("VivoxVoicePort")));
}
}
params.cwd = gDirUtilp->getAppRODataDir();
#ifndef LL_LINUX
......@@ -1038,6 +1023,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
sGatewayPtr = LLProcess::create(params);
mDaemonHost = LLHost(host.c_str(), port);
mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort"));
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment