From 6fd0baae5dfc1bca4670c94db584d92084dbb64d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 15 Jul 2013 02:38:10 +0200 Subject: [PATCH] Bug fix: don't get web profile when grid does not support that. --- indra/newview/llpanelprofile.cpp | 1 + indra/newview/llviewermedia.cpp | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index aa2c5dbd2..8237555ca 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -52,6 +52,7 @@ static const std::string PANEL_PICKS = "panel_picks"; std::string getProfileURL(const std::string& agent_name) { std::string url = gSavedSettings.getString("WebProfileURL"); + llassert(!url.empty()); LLSD subs; subs["AGENT_NAME"] = agent_name; url = LLWeb::expandURLSubstitutions(url,subs); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ee4162dce..c34103b4d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1446,20 +1446,24 @@ void LLViewerMedia::setOpenIDCookie() getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start)); - // Do a web profile get so we can store the cookie - AIHTTPHeaders headers; - headers.addHeader("Accept", "*/*"); - headers.addHeader("Cookie", sOpenIDCookie); - headers.addHeader("User-Agent", getCurrentUserAgent()); + // Does grid supports web profiles at all? + if (!gSavedSettings.getString("WebProfileURL").empty()) + { + // Do a web profile get so we can store the cookie + AIHTTPHeaders headers; + headers.addHeader("Accept", "*/*"); + headers.addHeader("Cookie", sOpenIDCookie); + headers.addHeader("User-Agent", getCurrentUserAgent()); - std::string profile_url = getProfileURL(""); - LLURL raw_profile_url( profile_url.c_str() ); + std::string profile_url = getProfileURL(""); + LLURL raw_profile_url( profile_url.c_str() ); - LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl; - LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl; - LLHTTPClient::get(profile_url, - new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), - headers); + LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl; + LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl; + LLHTTPClient::get(profile_url, + new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), + headers); + } } }