From 97bedac2a1274f26a6a346afccea7596f1d13923 Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Tue, 2 Aug 2011 11:08:07 -0400 Subject: Proxy: Improved mutex usage in LLProxy. Introduced an LLAtomic member to track the status of the http proxy that can be checked without locking a mutex. --- indra/newview/llstartup.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c934ff9f1b..3ec5842e3c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2785,6 +2785,7 @@ bool LLStartUp::handleSocksProxy() subs["HOST"] = http_host.getIPString(); subs["PORT"] = (S32)http_host.getPort(); LLNotificationsUtil::add("PROXY_INVALID_HTTP_HOST", subs); + return false; } } else if ((httpProxyType.compare("Socks") == 0) && gSavedSettings.getBOOL("Socks5ProxyEnabled")) @@ -2798,9 +2799,8 @@ bool LLStartUp::handleSocksProxy() subs["HOST"] = socks_host.getIPString(); subs["PORT"] = (S32)socks_host.getPort(); LLNotificationsUtil::add("PROXY_INVALID_SOCKS_HOST", subs); + return false; } - - } else if (httpProxyType.compare("None") == 0) { @@ -2816,7 +2816,6 @@ bool LLStartUp::handleSocksProxy() // Set up SOCKS proxy (if needed) if (gSavedSettings.getBOOL("Socks5ProxyEnabled")) { - // Determine and update LLProxy with the saved authentication system std::string auth_type = gSavedSettings.getString("Socks5AuthType"); @@ -2826,13 +2825,13 @@ bool LLStartUp::handleSocksProxy() std::string socks_user = socks_cred->getIdentifier()["username"].asString(); std::string socks_password = socks_cred->getAuthenticator()["creds"].asString(); - bool ok; - ok = LLProxy::getInstance()->setAuthPassword(socks_user, socks_password); + bool ok = LLProxy::getInstance()->setAuthPassword(socks_user, socks_password); + if (!ok) { LLNotificationsUtil::add("SOCKS_BAD_CREDS"); + return false; } - } else if (auth_type.compare("None") == 0) { -- cgit v1.2.3