diff options
author | Oz Linden <oz@lindenlab.com> | 2013-08-26 15:14:12 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-08-26 15:14:12 -0400 |
commit | 7ca10e516126e5fa9b076c04957b491495513907 (patch) | |
tree | 690323c7379c8151b1d7e251fa2878c10603fd61 /indra/viewer_components/updater/llupdatechecker.cpp | |
parent | 1e2a6ee3f440b7d076dc97f3a0628c90195f5386 (diff) | |
parent | 6e1138585bf745f73f0bb99ca62f77eeb273f1e4 (diff) |
merge changes for 3.6.4-release
Diffstat (limited to 'indra/viewer_components/updater/llupdatechecker.cpp')
-rwxr-xr-x | indra/viewer_components/updater/llupdatechecker.cpp | 58 |
1 files changed, 41 insertions, 17 deletions
diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 0b105cc1b6..3e170e44f4 100755 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -62,8 +62,7 @@ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client): } -void LLUpdateChecker::checkVersion(std::string const & hostUrl, - std::string const & servicePath, +void LLUpdateChecker::checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -71,7 +70,7 @@ void LLUpdateChecker::checkVersion(std::string const & hostUrl, unsigned char uniqueid[MD5HEX_STR_SIZE], bool willing_to_test) { - mImplementation->checkVersion(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); + mImplementation->checkVersion(urlBase, channel, version, platform, platform_version, uniqueid, willing_to_test); } @@ -98,8 +97,7 @@ LLUpdateChecker::Implementation::~Implementation() } -void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, - std::string const & servicePath, +void LLUpdateChecker::Implementation::checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -111,8 +109,7 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, { mInProgress = true; - mHostUrl = hostUrl; - mServicePath = servicePath; + mUrlBase = urlBase; mChannel = channel; mVersion = version; mPlatform = platform; @@ -122,7 +119,7 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, mProtocol = sProtocolVersion; - std::string checkUrl = buildUrl(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); + std::string checkUrl = buildUrl(urlBase, channel, version, platform, platform_version, uniqueid, willing_to_test); LL_INFOS("UpdaterService") << "checking for updates at " << checkUrl << LL_ENDL; mHttpClient.get(checkUrl, this); @@ -152,11 +149,40 @@ void LLUpdateChecker::Implementation::completed(U32 status, server_error += content["error_text"].asString(); } - LL_WARNS("UpdaterService") << "response error " << status - << " " << reason - << " (" << server_error << ")" - << LL_ENDL; - mClient.error(reason); + if (status == 404) + { + if (mProtocol == sProtocolVersion) + { + mProtocol = sLegacyProtocolVersion; + std::string retryUrl = buildUrl(mUrlBase, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); + + LL_WARNS("UpdaterService") + << "update response using " << sProtocolVersion + << " was HTTP 404 (" << server_error + << "); retry with legacy protocol " << mProtocol + << "\n at " << retryUrl + << LL_ENDL; + + mHttpClient.get(retryUrl, this); + } + else + { + LL_WARNS("UpdaterService") + << "update response using " << sLegacyProtocolVersion + << " was 404 (" << server_error + << "); request failed" + << LL_ENDL; + mClient.error(reason); + } + } + else + { + LL_WARNS("UpdaterService") << "response error " << status + << " " << reason + << " (" << server_error << ")" + << LL_ENDL; + mClient.error(reason); + } } else { @@ -173,8 +199,7 @@ void LLUpdateChecker::Implementation::error(U32 status, const std::string & reas } -std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUrl, - std::string const & servicePath, +std::string LLUpdateChecker::Implementation::buildUrl(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -183,7 +208,6 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUr bool willing_to_test) { LLSD path; - path.append(servicePath); path.append(mProtocol); path.append(channel); path.append(version); @@ -191,5 +215,5 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUr path.append(platform_version); path.append(willing_to_test ? "testok" : "testno"); path.append((char*)uniqueid); - return LLURI::buildHTTP(hostUrl, path).asString(); + return LLURI::buildHTTP(urlBase, path).asString(); } |