summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater/llupdaterservice.cpp
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-10-20 16:39:00 -0700
committercallum_linden <none@none>2015-10-20 16:39:00 -0700
commit6599e10d00f3a47e90136f5f6cb4b2d1e02cb2e5 (patch)
treed48c683923ee978db4dbb0d66cc0d9f45233a68e /indra/viewer_components/updater/llupdaterservice.cpp
parentc16e726d0e2a8c607ce441eb5bf2419b16b41cab (diff)
parent4312629e7c5749b86add9d42e6e550602f34dbf5 (diff)
Merge with tip of viewer-release
Diffstat (limited to 'indra/viewer_components/updater/llupdaterservice.cpp')
-rwxr-xr-xindra/viewer_components/updater/llupdaterservice.cpp56
1 files changed, 53 insertions, 3 deletions
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index c152493a51..788955a1b2 100755
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -132,6 +132,7 @@ public:
void startChecking(bool install_if_ready);
void stopChecking();
+ bool forceCheck();
bool isChecking();
LLUpdaterService::eUpdaterState getState();
@@ -266,6 +267,46 @@ void LLUpdaterServiceImpl::stopChecking()
setState(LLUpdaterService::TERMINAL);
}
+bool LLUpdaterServiceImpl::forceCheck()
+{
+ if (!mIsDownloading && getState() != LLUpdaterService::CHECKING_FOR_UPDATE)
+ {
+ if (mIsChecking)
+ {
+ // Service is running, just reset the timer
+ if (mTimer.getStarted())
+ {
+ mTimer.setTimerExpirySec(0);
+ setState(LLUpdaterService::CHECKING_FOR_UPDATE);
+ return true;
+ }
+ }
+ else if (!mChannel.empty() && !mVersion.empty())
+ {
+ // one time check
+ bool has_install = checkForInstall(false);
+ if (!has_install)
+ {
+ std::string query_url = LLGridManager::getInstance()->getUpdateServiceURL();
+ if (!query_url.empty())
+ {
+ setState(LLUpdaterService::CHECKING_FOR_UPDATE);
+ mUpdateChecker.checkVersion(query_url, mChannel, mVersion,
+ mPlatform, mPlatformVersion, mUniqueId,
+ mWillingToTest);
+ return true;
+ }
+ else
+ {
+ LL_WARNS("UpdaterService")
+ << "No updater service defined for grid '" << LLGridManager::getInstance()->getGrid() << LL_ENDL;
+ }
+ }
+ }
+ }
+ return false;
+}
+
bool LLUpdaterServiceImpl::isChecking()
{
return mIsChecking;
@@ -402,9 +443,9 @@ bool LLUpdaterServiceImpl::checkForResume()
void LLUpdaterServiceImpl::error(std::string const & message)
{
+ setState(LLUpdaterService::TEMPORARY_ERROR);
if(mIsChecking)
{
- setState(LLUpdaterService::TEMPORARY_ERROR);
restartTimer(mCheckPeriod);
}
}
@@ -449,8 +490,12 @@ void LLUpdaterServiceImpl::response(LLSD const & content)
else
{
LL_WARNS("UpdaterService") << "Invalid update query response ignored; retry in "
- << mCheckPeriod << " seconds" << LL_ENDL;
- restartTimer(mCheckPeriod);
+ << mCheckPeriod << " seconds" << LL_ENDL;
+ setState(LLUpdaterService::TEMPORARY_ERROR);
+ if (mIsChecking)
+ {
+ restartTimer(mCheckPeriod);
+ }
}
}
@@ -672,6 +717,11 @@ void LLUpdaterService::stopChecking()
mImpl->stopChecking();
}
+bool LLUpdaterService::forceCheck()
+{
+ return mImpl->forceCheck();
+}
+
bool LLUpdaterService::isChecking()
{
return mImpl->isChecking();