summaryrefslogtreecommitdiff
path: root/indra/viewer_components
diff options
context:
space:
mode:
Diffstat (limited to 'indra/viewer_components')
-rw-r--r--indra/viewer_components/updater/llupdatechecker.cpp20
-rw-r--r--indra/viewer_components/updater/llupdatechecker.h4
-rw-r--r--indra/viewer_components/updater/llupdaterservice.cpp11
-rw-r--r--indra/viewer_components/updater/llupdaterservice.h1
-rw-r--r--indra/viewer_components/updater/tests/llupdaterservice_test.cpp7
5 files changed, 24 insertions, 19 deletions
diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp
index daa867e692..39f68ac0f5 100644
--- a/indra/viewer_components/updater/llupdatechecker.cpp
+++ b/indra/viewer_components/updater/llupdatechecker.cpp
@@ -66,11 +66,12 @@ void LLUpdateChecker::checkVersion(std::string const & hostUrl,
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test)
{
- mImplementation->checkVersion(hostUrl, servicePath, channel, version, platform_version, uniqueid, willing_to_test);
+ mImplementation->checkVersion(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test);
}
@@ -102,6 +103,7 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl,
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test)
@@ -114,13 +116,14 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl,
mServicePath = servicePath;
mChannel = channel;
mVersion = version;
+ mPlatform = platform;
mPlatformVersion = platform_version;
memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE);
mWillingToTest = willing_to_test;
mProtocol = sProtocolVersion;
- std::string checkUrl = buildUrl(hostUrl, servicePath, channel, version, platform_version, uniqueid, willing_to_test);
+ std::string checkUrl = buildUrl(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test);
LL_INFOS("UpdaterService") << "checking for updates at " << checkUrl << LL_ENDL;
mHttpClient.get(checkUrl, this);
@@ -150,7 +153,7 @@ void LLUpdateChecker::Implementation::completed(U32 status,
if (mProtocol == sProtocolVersion)
{
mProtocol = sLegacyProtocolVersion;
- std::string retryUrl = buildUrl(mHostUrl, mServicePath, mChannel, mVersion, mPlatformVersion, mUniqueId, mWillingToTest);
+ std::string retryUrl = buildUrl(mHostUrl, mServicePath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest);
LL_WARNS("UpdaterService")
<< "update response using " << sProtocolVersion
@@ -199,20 +202,11 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUr
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test)
{
-#ifdef LL_WINDOWS
- static const char * platform = "win";
-#elif LL_DARWIN
- static const char *platform = "mac";
-#elif LL_LINUX
- static const char * platform = "lnx";
-#else
-# error "unsupported platform"
-#endif
-
LLSD path;
path.append(servicePath);
path.append(mProtocol);
diff --git a/indra/viewer_components/updater/llupdatechecker.h b/indra/viewer_components/updater/llupdatechecker.h
index 55806137d7..8e85587490 100644
--- a/indra/viewer_components/updater/llupdatechecker.h
+++ b/indra/viewer_components/updater/llupdatechecker.h
@@ -47,6 +47,7 @@ public:
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test
@@ -70,6 +71,7 @@ public:
std::string mHostUrl;
std::string mServicePath;
std::string mChannel;
+ std::string mPlatform;
std::string mPlatformVersion;
unsigned char mUniqueId[MD5HEX_STR_SIZE];
bool mWillingToTest;
@@ -78,6 +80,7 @@ public:
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test);
@@ -96,6 +99,7 @@ public:
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test);
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index cac6f191df..1bd9fa4fc0 100644
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -97,6 +97,7 @@ class LLUpdaterServiceImpl :
std::string mPath;
std::string mChannel;
std::string mVersion;
+ std::string mPlatform;
std::string mPlatformVersion;
unsigned char mUniqueId[MD5HEX_STR_SIZE];
bool mWillingToTest;
@@ -123,6 +124,7 @@ public:
const std::string& path,
const std::string& channel,
const std::string& version,
+ const std::string& platform,
const std::string& platform_version,
const unsigned char uniqueid[MD5HEX_STR_SIZE],
const bool& willing_to_test
@@ -185,7 +187,8 @@ void LLUpdaterServiceImpl::initialize(const std::string& url,
const std::string& path,
const std::string& channel,
const std::string& version,
- const std::string & platform_version,
+ const std::string& platform,
+ const std::string& platform_version,
const unsigned char uniqueid[MD5HEX_STR_SIZE],
const bool& willing_to_test)
{
@@ -199,6 +202,7 @@ void LLUpdaterServiceImpl::initialize(const std::string& url,
mPath = path;
mChannel = channel;
mVersion = version;
+ mPlatform = platform;
mPlatformVersion = platform_version;
memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE);
mWillingToTest = willing_to_test;
@@ -561,7 +565,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
}
else
{
- mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatformVersion, mUniqueId, mWillingToTest);
+ mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest);
setState(LLUpdaterService::CHECKING_FOR_UPDATE);
}
}
@@ -610,12 +614,13 @@ void LLUpdaterService::initialize(const std::string& url,
const std::string& path,
const std::string& channel,
const std::string& version,
+ const std::string& platform,
const std::string& platform_version,
const unsigned char uniqueid[MD5HEX_STR_SIZE],
const bool& willing_to_test
)
{
- mImpl->initialize(url, path, channel, version, platform_version, uniqueid, willing_to_test);
+ mImpl->initialize(url, path, channel, version, platform, platform_version, uniqueid, willing_to_test);
}
void LLUpdaterService::setCheckPeriod(unsigned int seconds)
diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h
index 48d3590f1b..982f99b861 100644
--- a/indra/viewer_components/updater/llupdaterservice.h
+++ b/indra/viewer_components/updater/llupdaterservice.h
@@ -75,6 +75,7 @@ public:
const std::string& path,
const std::string& channel,
const std::string& version,
+ const std::string& platform,
const std::string& platform_version,
const unsigned char uniqueid[MD5HEX_STR_SIZE],
const bool& willing_to_test
diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
index a7b8a74b61..4812272ebc 100644
--- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
+++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
@@ -48,6 +48,7 @@ void LLUpdateChecker::checkVersion(std::string const & hostUrl,
std::string const & servicePath,
std::string const & channel,
std::string const & version,
+ std::string const & platform,
std::string const & platform_version,
unsigned char uniqueid[MD5HEX_STR_SIZE],
bool willing_to_test)
@@ -178,10 +179,10 @@ namespace tut
try
{
unsigned char id1[MD5HEX_STR_SIZE] = "11111111111111111111111111111111";
- updater.initialize(test_url, "update" ,test_channel, test_version, "1.2.3", id1, true);
+ updater.initialize(test_url, "update" ,test_channel, test_version, "win", "1.2.3", id1, true);
updater.startChecking();
unsigned char id2[MD5HEX_STR_SIZE] = "22222222222222222222222222222222";
- updater.initialize("other_url", "update", test_channel, test_version, "4.5.6", id2, true);
+ updater.initialize("other_url", "update", test_channel, test_version, "win", "4.5.6", id2, true);
}
catch(LLUpdaterService::UsageError)
{
@@ -196,7 +197,7 @@ namespace tut
DEBUG;
LLUpdaterService updater;
unsigned char id[MD5HEX_STR_SIZE] = "33333333333333333333333333333333";
- updater.initialize(test_url, "update", test_channel, test_version, "7.8.9", id, true);
+ updater.initialize(test_url, "update", test_channel, test_version, "win", "7.8.9", id, true);
updater.startChecking();
ensure(updater.isChecking());
updater.stopChecking();