diff options
Diffstat (limited to 'indra/viewer_components/updater/llupdatechecker.cpp')
-rw-r--r-- | indra/viewer_components/updater/llupdatechecker.cpp | 62 |
1 files changed, 19 insertions, 43 deletions
diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index c6aa9b0f11..5edbbf9914 100644 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -30,7 +30,9 @@ #include "llsd.h" #include "llupdatechecker.h" #include "lluri.h" - +#if LL_DARWIN +#include <CoreServices/CoreServices.h> +#endif #if LL_WINDOWS #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally @@ -49,37 +51,6 @@ public: }; -class LLUpdateChecker::Implementation: - public LLHTTPClient::Responder -{ -public: - Implementation(Client & client); - ~Implementation(); - void check(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version); - - // 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 * sProtocolVersion; - - Client & mClient; - LLHTTPClient mHttpClient; - bool mInProgress; - std::string mVersion; - - std::string buildUrl(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version); - - LOG_CLASS(LLUpdateChecker::Implementation); -}; - - - // LLUpdateChecker //----------------------------------------------------------------------------- @@ -91,10 +62,10 @@ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client): } -void LLUpdateChecker::check(std::string const & protocolVersion, std::string const & hostUrl, +void LLUpdateChecker::checkVersion(std::string const & protocolVersion, std::string const & hostUrl, std::string const & servicePath, std::string channel, std::string version) { - mImplementation->check(protocolVersion, hostUrl, servicePath, channel, version); + mImplementation->checkVersion(protocolVersion, hostUrl, servicePath, channel, version); } @@ -120,7 +91,7 @@ LLUpdateChecker::Implementation::~Implementation() } -void LLUpdateChecker::Implementation::check(std::string const & protocolVersion, std::string const & hostUrl, +void LLUpdateChecker::Implementation::checkVersion(std::string const & protocolVersion, std::string const & hostUrl, std::string const & servicePath, std::string channel, std::string version) { llassert(!mInProgress); @@ -132,13 +103,7 @@ void LLUpdateChecker::Implementation::check(std::string const & protocolVersion, std::string checkUrl = buildUrl(protocolVersion, hostUrl, servicePath, channel, version); LL_INFOS("UpdateCheck") << "checking for updates at " << checkUrl << llendl; - // The HTTP client will wrap a raw pointer in a boost::intrusive_ptr causing the - // passed object to be silently and automatically deleted. We pass a self- - // referential intrusive pointer to which we add a reference to keep the - // client from deleting the update checker implementation instance. - LLHTTPClient::ResponderPtr temporaryPtr(this); - boost::intrusive_ptr_add_ref(temporaryPtr.get()); - mHttpClient.get(checkUrl, temporaryPtr); + mHttpClient.get(checkUrl, this); } void LLUpdateChecker::Implementation::completed(U32 status, @@ -179,7 +144,18 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & protoc #ifdef LL_WINDOWS static const char * platform = "win"; #elif LL_DARWIN - static const char * platform = "mac"; + long versMin; + Gestalt(gestaltSystemVersionMinor, &versMin); + + static const char *platform; + if (versMin == 5) //OS 10.5 + { + platform = "mac_legacy"; + } + else + { + platform = "mac"; + } #else static const char * platform = "lnx"; #endif |