From 8e4d6bb1acca21069b4038a2cdf56e18196d6cb2 Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Fri, 14 Jan 2011 12:59:42 -0800
Subject: [PATCH] fix CHOP-366, on temporary errors (e.g. version manager
 returns other than 200) show error dialog instructing the user to manually
 install the latest viewer.

---
 indra/newview/lllogininstance.cpp                    | 6 +++++-
 indra/viewer_components/updater/llupdaterservice.cpp | 1 +
 indra/viewer_components/updater/llupdaterservice.h   | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index d866db18292..efb2e9c0fd6 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -214,6 +214,9 @@ void MandatoryUpdateMachine::start(void)
 			case LLUpdaterService::CHECKING_FOR_UPDATE:
 				setCurrentState(new CheckingForUpdate(*this));
 				break;
+			case LLUpdaterService::TEMPORARY_ERROR:
+				setCurrentState(new Error(*this));
+				break;
 			case LLUpdaterService::DOWNLOADING:
 				setCurrentState(new WaitingForDownload(*this));
 				break;
@@ -289,6 +292,7 @@ bool MandatoryUpdateMachine::CheckingForUpdate::onEvent(LLSD const & event)
 			case LLUpdaterService::DOWNLOADING:
 				mMachine.setCurrentState(new WaitingForDownload(mMachine));
 				break;
+			case LLUpdaterService::TEMPORARY_ERROR:
 			case LLUpdaterService::UP_TO_DATE:
 			case LLUpdaterService::TERMINAL:
 			case LLUpdaterService::FAILURE:
@@ -324,7 +328,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine):
 void MandatoryUpdateMachine::Error::enter(void)
 {
 	llinfos << "entering error" << llendl;
-	LLNotificationsUtil::add("FailedUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2));
+	LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2));
 }
 
 
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index aa4983a3b66..ea242f45cda 100644
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -361,6 +361,7 @@ void LLUpdaterServiceImpl::error(std::string const & message)
 {
 	if(mIsChecking)
 	{
+		setState(LLUpdaterService::TEMPORARY_ERROR);
 		restartTimer(mCheckPeriod);
 	}
 }
diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h
index 421481bc43d..450f19c1c6d 100644
--- a/indra/viewer_components/updater/llupdaterservice.h
+++ b/indra/viewer_components/updater/llupdaterservice.h
@@ -59,6 +59,7 @@ class LLUpdaterService
 	enum eUpdaterState {
 		INITIAL,
 		CHECKING_FOR_UPDATE,
+		TEMPORARY_ERROR,
 		DOWNLOADING,
 		INSTALLING,
 		UP_TO_DATE,
-- 
GitLab