summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-03-05 21:16:30 +0200
committerandreykproductengine <akleshchev@productengine.com>2015-03-05 21:16:30 +0200
commit07af9656c3ec0dccfc2ebf86f23bd664c19d8395 (patch)
treed523ad1f5de6ded106cca3af9382598ec45de82f /indra/newview/llstartup.cpp
parent8d8ea3b82ffd200a162ac2d07b438335d27e54d8 (diff)
MAINT-4930 FIXED Fix viewer error checking for max-agent-groups in viewer
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rwxr-xr-xindra/newview/llstartup.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 9da7717b74..b3278b2437 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -240,7 +240,8 @@ static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f);
static std::string gAgentStartLocation = "safe";
static bool mLoginStatePastUI = false;
-const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
+const S32 DEFAULT_MAX_AGENT_GROUPS = 42;
+const S32 ALLOWED_MAX_AGENT_GROUPS = 500;
boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
boost::scoped_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener());
@@ -3489,15 +3490,24 @@ bool process_login_success_response()
LLViewerMedia::openIDSetup(openid_url, openid_token);
}
- if(response.has("max-agent-groups")) {
- std::string max_agent_groups(response["max-agent-groups"]);
- gMaxAgentGroups = atoi(max_agent_groups.c_str());
- LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: "
- << gMaxAgentGroups << LL_ENDL;
+ gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
+ if(response.has("max-agent-groups"))
+ {
+ S32 agent_groups = atoi(std::string(response["max-agent-groups"]).c_str());
+ if (agent_groups > 0 && agent_groups <= ALLOWED_MAX_AGENT_GROUPS)
+ {
+ gMaxAgentGroups = agent_groups;
+ LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: "
+ << gMaxAgentGroups << LL_ENDL;
+ }
+ else
+ {
+ LL_INFOS("LLStartup") << "Invalid value received, using defaults for gMaxAgentGroups: "
+ << gMaxAgentGroups << LL_ENDL;
+ }
}
else {
- gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
- LL_INFOS("LLStartup") << "using gMaxAgentGroups default: "
+ LL_INFOS("LLStartup") << "Missing max-agent-groups, using default value for gMaxAgentGroups: "
<< gMaxAgentGroups << LL_ENDL;
}