add platform and platform version to login request parameters for new version manager query
parent
e68ab0a563
commit
c17db85e73
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -322,6 +322,8 @@ typedef enum
|
|||
|
||||
extern eLastExecEvent gLastExecEvent; // llstartup
|
||||
|
||||
extern const char* gPlatform;
|
||||
|
||||
extern U32 gFrameCount;
|
||||
extern U32 gForegroundFrameCount;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(¬ifications);
|
||||
logininstance->setPlatformInfo("win", "1.3.5");
|
||||
}
|
||||
|
||||
LLLoginInstance* logininstance;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue