summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-03-27 13:20:48 -0400
committerOz Linden <oz@lindenlab.com>2013-03-27 13:20:48 -0400
commitc17db85e73a91c145d6eebe36b3b05e2289deae0 (patch)
tree1c534495d9242497715d9f01d43e643b34bb9cb7 /indra
parente68ab0a563061d3d65a3f552a1f5856071bd230e (diff)
add platform and platform version to login request parameters for new version manager query
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewer.cpp29
-rw-r--r--indra/newview/llappviewer.h2
-rw-r--r--indra/newview/lllogininstance.cpp9
-rw-r--r--indra/newview/lllogininstance.h3
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp4
-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
10 files changed, 59 insertions, 31 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 742c29cc88..47a0cb02e4 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -271,6 +271,19 @@ BOOL gUseQuickTime = TRUE;
eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL;
+#if LL_WINDOWS
+# define LL_PLATFORM_KEY "win"
+#elif LL_DARWIN
+# define LL_PLATFORM_KEY "mac"
+#elif LL_LINUX
+# define LL_PLATFORM_KEY "lnx"
+#elif LL_SOLARIS
+# define LL_PLATFORM_KEY "sol"
+#else
+# error "Unknown Platform"
+#endif
+const char* gPlatform = LL_PLATFORM_KEY;
+
LLSD gDebugInfo;
U32 gFrameCount = 0;
@@ -669,6 +682,7 @@ LLAppViewer::LLAppViewer() :
gLoggedInTime.stop();
LLLoginInstance::instance().setUpdaterService(mUpdater.get());
+ LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString());
}
LLAppViewer::~LLAppViewer()
@@ -3014,6 +3028,7 @@ void LLAppViewer::initUpdater()
service_path,
channel,
version,
+ gPlatform,
getOSInfo().getOSVersionString(),
unique_id,
willing_to_test
@@ -5189,17 +5204,9 @@ void LLAppViewer::handleLoginComplete()
void LLAppViewer::launchUpdater()
{
- LLSD query_map = LLSD::emptyMap();
- // *TODO place os string in a global constant
-#if LL_WINDOWS
- query_map["os"] = "win";
-#elif LL_DARWIN
- query_map["os"] = "mac";
-#elif LL_LINUX
- query_map["os"] = "lnx";
-#elif LL_SOLARIS
- query_map["os"] = "sol";
-#endif
+ LLSD query_map = LLSD::emptyMap();
+ query_map["os"] = gPlatform;
+
// *TODO change userserver to be grid on both viewer and sim, since
// userserver no longer exists.
query_map["userserver"] = LLGridManager::getInstance()->getGridId();
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 7563d672e3..69056074e9 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -322,6 +322,8 @@ typedef enum
extern eLastExecEvent gLastExecEvent; // llstartup
+extern const char* gPlatform;
+
extern U32 gFrameCount;
extern U32 gForegroundFrameCount;
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index b27a566c23..a9b7342963 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -488,6 +488,13 @@ LLLoginInstance::LLLoginInstance() :
mDispatcher.add("indeterminate", "", boost::bind(&LLLoginInstance::handleIndeterminate, this, _1));
}
+void LLLoginInstance::setPlatformInfo(const std::string platform,
+ const std::string platform_version)
+{
+ mPlatform = platform;
+ mPlatformVersion = platform_version;
+}
+
LLLoginInstance::~LLLoginInstance()
{
}
@@ -592,6 +599,8 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
request_params["mac"] = (char*)hashed_unique_id_string;
request_params["version"] = LLVersionInfo::getChannelAndVersion(); // Includes channel name
request_params["channel"] = LLVersionInfo::getChannel();
+ request_params["platform"] = mPlatform;
+ request_params["platform_version"] = mPlatformVersion;
request_params["id0"] = mSerialNumber;
request_params["host_id"] = gSavedSettings.getString("HostID");
request_params["extended_errors"] = true; // request message_id and message_args
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
index 8b53431219..83191e50bd 100644
--- a/indra/newview/lllogininstance.h
+++ b/indra/newview/lllogininstance.h
@@ -66,6 +66,7 @@ public:
void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; }
void setSerialNumber(const std::string& sn) { mSerialNumber = sn; }
void setLastExecEvent(int lee) { mLastExecEvent = lee; }
+ void setPlatformInfo(const std::string platform, const std::string platform_version);
void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; }
@@ -99,6 +100,8 @@ private:
F64 mTransferRate;
std::string mSerialNumber;
int mLastExecEvent;
+ std::string mPlatform;
+ std::string mPlatformVersion;
UpdaterLauncherCallback mUpdaterLauncher;
LLEventDispatcher mDispatcher;
LLUpdaterService * mUpdaterService;
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index a86230488b..faf46f0984 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -73,7 +73,7 @@ void LLViewerWindow::setShowProgress(BOOL show) {}
LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; }
LLViewerWindow* gViewerWindow;
-
+
class LLLogin::Impl
{
};
@@ -212,6 +212,7 @@ 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
@@ -369,6 +370,7 @@ namespace tut
accountCredential->setCredentialData(identifier, authenticator);
logininstance->setNotificationsInterface(&notifications);
+ logininstance->setPlatformInfo("win", "1.3.5");
}
LLLoginInstance* logininstance;
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();