summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterabout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterabout.cpp')
-rwxr-xr-xindra/newview/llfloaterabout.cpp95
1 files changed, 49 insertions, 46 deletions
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index c5d637d1fc..bababca652 100755
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -50,7 +50,6 @@
// Linden library includes
#include "llaudioengine.h"
#include "llbutton.h"
-#include "llcurl.h"
#include "llglheaders.h"
#include "llfloater.h"
#include "llfloaterreg.h"
@@ -63,6 +62,7 @@
#include "stringize.h"
#include "llsdutil_math.h"
#include "lleventapi.h"
+#include "llcorehttputil.h"
#if LL_WINDOWS
#include "lldxhardware.h"
@@ -72,18 +72,6 @@ extern LLMemoryInfo gSysMemory;
extern U32 gPacketsIn;
///----------------------------------------------------------------------------
-/// Class LLServerReleaseNotesURLFetcher
-///----------------------------------------------------------------------------
-class LLServerReleaseNotesURLFetcher : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLServerReleaseNotesURLFetcher);
-public:
- static void startFetch();
-private:
- /* virtual */ void httpCompleted();
-};
-
-///----------------------------------------------------------------------------
/// Class LLFloaterAbout
///----------------------------------------------------------------------------
class LLFloaterAbout
@@ -118,6 +106,9 @@ private:
// listener name for update checks
static const std::string sCheckUpdateListenerName;
+
+ static void startFetchServerReleaseNotes();
+ static void handleServerReleaseNotes(LLSD results);
};
@@ -157,7 +148,7 @@ BOOL LLFloaterAbout::postBuild()
{
// start fetching server release notes URL
setSupportText(LLTrans::getString("RetrievingData"));
- LLServerReleaseNotesURLFetcher::startFetch();
+ startFetchServerReleaseNotes();
}
else // not logged in
{
@@ -220,6 +211,50 @@ LLSD LLFloaterAbout::getInfo()
return LLAppViewer::instance()->getViewerInfo();
}
+/*static*/
+void LLFloaterAbout::startFetchServerReleaseNotes()
+{
+ LLViewerRegion* region = gAgent.getRegion();
+ if (!region) return;
+
+ // We cannot display the URL returned by the ServerReleaseNotes capability
+ // because opening it in an external browser will trigger a warning about untrusted
+ // SSL certificate.
+ // So we query the URL ourselves, expecting to find
+ // an URL suitable for external browsers in the "Location:" HTTP header.
+ std::string cap_url = region->getCapability("ServerReleaseNotes");
+
+ LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(cap_url,
+ &LLFloaterAbout::handleServerReleaseNotes, &LLFloaterAbout::handleServerReleaseNotes);
+
+}
+
+/*static*/
+void LLFloaterAbout::handleServerReleaseNotes(LLSD results)
+{
+// LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about");
+// if (floater_about)
+// {
+ LLSD http_headers;
+ if (results.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS))
+ {
+ LLSD http_results = results[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ http_headers = http_results[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS];
+ }
+ else
+ {
+ http_headers = results[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS];
+ }
+
+ std::string location = http_headers[HTTP_IN_HEADER_LOCATION].asString();
+ if (location.empty())
+ {
+ location = LLTrans::getString("ErrorFetchingServerReleaseNotesURL");
+ }
+ LLAppViewer::instance()->setServerReleaseNotesURL(location);
+// }
+}
+
class LLFloaterAboutListener: public LLEventAPI
{
public:
@@ -356,35 +391,3 @@ void LLFloaterAboutUtil::checkUpdatesAndNotify()
LLFloaterAbout::setUpdateListener();
}
-///----------------------------------------------------------------------------
-/// Class LLServerReleaseNotesURLFetcher implementation
-///----------------------------------------------------------------------------
-// static
-void LLServerReleaseNotesURLFetcher::startFetch()
-{
- LLViewerRegion* region = gAgent.getRegion();
- if (!region) return;
-
- // We cannot display the URL returned by the ServerReleaseNotes capability
- // because opening it in an external browser will trigger a warning about untrusted
- // SSL certificate.
- // So we query the URL ourselves, expecting to find
- // an URL suitable for external browsers in the "Location:" HTTP header.
- std::string cap_url = region->getCapability("ServerReleaseNotes");
- LLHTTPClient::get(cap_url, new LLServerReleaseNotesURLFetcher);
-}
-
-// virtual
-void LLServerReleaseNotesURLFetcher::httpCompleted()
-{
- LL_DEBUGS("ServerReleaseNotes") << dumpResponse()
- << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
-
- std::string location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
- if (location.empty())
- {
- location = LLTrans::getString("ErrorFetchingServerReleaseNotesURL");
- }
- LLAppViewer::instance()->setServerReleaseNotesURL(location);
-}
-