summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater/llupdatechecker.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/viewer_components/updater/llupdatechecker.h')
-rwxr-xr-x[-rw-r--r--]indra/viewer_components/updater/llupdatechecker.h75
1 files changed, 59 insertions, 16 deletions
diff --git a/indra/viewer_components/updater/llupdatechecker.h b/indra/viewer_components/updater/llupdatechecker.h
index cea1f13647..4244007340 100644..100755
--- a/indra/viewer_components/updater/llupdatechecker.h
+++ b/indra/viewer_components/updater/llupdatechecker.h
@@ -29,6 +29,8 @@
#include <boost/shared_ptr.hpp>
+#include "llmd5.h"
+#include "llhttpclient.h"
//
// Implements asynchronous checking for updates.
@@ -36,7 +38,53 @@
class LLUpdateChecker {
public:
class Client;
- class Implementation;
+ class Implementation: public LLHTTPClient::Responder
+ {
+ public:
+ Implementation(Client & client);
+ ~Implementation();
+ void checkVersion(std::string const & urlBase,
+ 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
+ );
+
+ // Responder:
+ virtual void completed(U32 status,
+ const std::string & reason,
+ const LLSD& content);
+ virtual void error(U32 status, const std::string & reason);
+
+ private:
+ static const char * sLegacyProtocolVersion;
+ static const char * sProtocolVersion;
+ const char* mProtocol;
+
+ Client & mClient;
+ LLHTTPClient mHttpClient;
+ bool mInProgress;
+ std::string mVersion;
+ std::string mUrlBase;
+ std::string mChannel;
+ std::string mPlatform;
+ std::string mPlatformVersion;
+ unsigned char mUniqueId[MD5HEX_STR_SIZE];
+ bool mWillingToTest;
+
+ std::string buildUrl(std::string const & urlBase,
+ 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);
+
+ LOG_CLASS(LLUpdateChecker::Implementation);
+ };
+
// An exception that may be raised on check errors.
class CheckError;
@@ -44,11 +92,16 @@ public:
LLUpdateChecker(Client & client);
// Check status of current app on the given host for the channel and version provided.
- void check(std::string const & protocolVersion, std::string const & hostUrl,
- std::string const & servicePath, std::string channel, std::string version);
+ void checkVersion(std::string const & urlBase,
+ 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);
private:
- boost::shared_ptr<Implementation> mImplementation;
+ LLPointer<Implementation> mImplementation;
};
@@ -64,18 +117,8 @@ public:
// An error occurred while checking for an update.
virtual void error(std::string const & message) = 0;
- // A newer version is available, but the current version may still be used.
- virtual void optionalUpdate(std::string const & newVersion,
- LLURI const & uri,
- std::string const & hash) = 0;
-
- // A newer version is available, and the current version is no longer valid.
- virtual void requiredUpdate(std::string const & newVersion,
- LLURI const & uri,
- std::string const & hash) = 0;
-
- // The checked version is up to date; no newer version exists.
- virtual void upToDate(void) = 0;
+ // A successful response was received from the viewer version manager
+ virtual void response(LLSD const & content) = 0;
};