summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-04-04 15:53:09 -0400
committerOz Linden <oz@lindenlab.com>2016-04-04 15:53:09 -0400
commit9be58e915a6c69de280ccabd3019e9ac40beed26 (patch)
treead6f8f1f754a865afb761d0f17744cc7e1ef8b74 /indra/newview/llappviewer.cpp
parentab46c9226bd9048fa218f54bc8668594401529e7 (diff)
parent18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff)
merge with 4.0.3-release
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp118
1 files changed, 21 insertions, 97 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c146e97c2e..aa152ffdd6 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -57,8 +57,6 @@
#include "llfocusmgr.h"
#include "llviewerjoystick.h"
#include "llallocator.h"
-#include "llares.h"
-#include "llcurl.h"
#include "llcalc.h"
#include "llconversationlog.h"
#include "lldxhardware.h"
@@ -230,7 +228,7 @@
#include "llmachineid.h"
#include "llmainlooprepeater.h"
-
+#include "llcoproceduremanager.h"
#include "llviewereventrecorder.h"
@@ -759,8 +757,11 @@ void fast_exit(int rc)
{
_exit(rc);
}
+
+
}
+
bool LLAppViewer::init()
{
setupErrorHandling(mSecondInstance);
@@ -829,12 +830,7 @@ bool LLAppViewer::init()
// before consumers (LLTextureFetch).
mAppCoreHttp.init();
- // *NOTE:Mani - LLCurl::initClass is not thread safe.
- // Called before threads are created.
- LLCurl::initClass(gSavedSettings.getF32("CurlRequestTimeOut"),
- gSavedSettings.getS32("CurlMaximumNumberOfHandles"),
- gSavedSettings.getBOOL("CurlUseMultipleThreads"));
- LL_INFOS("InitInfo") << "LLCurl initialized." << LL_ENDL ;
+ LL_INFOS("InitInfo") << "LLCore::Http initialized." << LL_ENDL ;
LLMachineID::init();
@@ -904,7 +900,7 @@ bool LLAppViewer::init()
// the libs involved in getting to a full login screen.
//
LL_INFOS("InitInfo") << "J2C Engine is: " << LLImageJ2C::getEngineInfo() << LL_ENDL;
- LL_INFOS("InitInfo") << "libcurl version is: " << LLCurl::getVersionString() << LL_ENDL;
+ LL_INFOS("InitInfo") << "libcurl version is: " << LLCore::LLHttp::getCURLVersion() << LL_ENDL;
/////////////////////////////////////////////////
// OS-specific login dialogs
@@ -1161,8 +1157,6 @@ bool LLAppViewer::init()
{
LLNotificationsUtil::add("CorruptedProtectedDataStore");
}
- LLHTTPClient::setCertVerifyCallback(secapiSSLCertVerifyCallback);
-
gGLActive = FALSE;
@@ -1220,6 +1214,12 @@ bool LLAppViewer::init()
LLAgentLanguage::init();
+ /// Tell the Coprocedure manager how to discover and store the pool sizes
+ // what I wanted
+ LLCoprocedureManager::getInstance()->setPropertyMethods(
+ boost::bind(&LLControlGroup::getU32, boost::ref(gSavedSettings), _1),
+ boost::bind(&LLControlGroup::declareU32, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_ALWAYS));
+
return true;
}
@@ -1286,7 +1286,6 @@ static LLTrace::BlockTimerStatHandle FTM_LFS("LFS Thread");
static LLTrace::BlockTimerStatHandle FTM_PAUSE_THREADS("Pause Threads");
static LLTrace::BlockTimerStatHandle FTM_IDLE("Idle");
static LLTrace::BlockTimerStatHandle FTM_PUMP("Pump");
-static LLTrace::BlockTimerStatHandle FTM_PUMP_ARES("Ares");
static LLTrace::BlockTimerStatHandle FTM_PUMP_SERVICE("Service");
static LLTrace::BlockTimerStatHandle FTM_SERVICE_CALLBACK("Callback");
static LLTrace::BlockTimerStatHandle FTM_AGENT_AUTOPILOT("Autopilot");
@@ -1310,8 +1309,6 @@ bool LLAppViewer::mainLoop()
// Create IO Pump to use for HTTP Requests.
gServicePump = new LLPumpIO(gAPRPoolp);
- LLHTTPClient::setPump(*gServicePump);
- LLCurl::setCAFile(gDirUtilp->getCAFile());
// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
@@ -1430,26 +1427,6 @@ bool LLAppViewer::mainLoop()
LL_RECORD_BLOCK_TIME(FTM_IDLE);
idle();
- if (gAres != NULL && gAres->isInitialized())
- {
- pingMainloopTimeout("Main:ServicePump");
- LL_RECORD_BLOCK_TIME(FTM_PUMP);
- {
- LL_RECORD_BLOCK_TIME(FTM_PUMP_ARES);
- gAres->process();
- }
- {
- LL_RECORD_BLOCK_TIME(FTM_PUMP_SERVICE);
- // this pump is necessary to make the login screen show up
- gServicePump->pump();
-
- {
- LL_RECORD_BLOCK_TIME(FTM_SERVICE_CALLBACK);
- gServicePump->callback();
- }
- }
- }
-
resumeMainloopTimeout();
}
@@ -1554,11 +1531,6 @@ bool LLAppViewer::mainLoop()
}
gMeshRepo.update() ;
- if(!LLCurl::getCurlThread()->update(1))
- {
- LLCurl::getCurlThread()->pause() ; //nothing in the curl thread.
- }
-
if(!total_work_pending) //pause texture fetching threads if nothing to process.
{
LLAppViewer::getTextureCache()->pause();
@@ -1799,13 +1771,14 @@ bool LLAppViewer::cleanup()
if (gAudiop)
{
- // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
-
- LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
+ // be sure to stop the internet stream cleanly BEFORE destroying the interface to stop it.
+ gAudiop->stopInternetStream();
+ // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
+ LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
delete sai;
gAudiop->setStreamingAudioImpl(NULL);
- // shut down the audio subsystem
+ // shut down the audio subsystem
gAudiop->shutdown();
delete gAudiop;
@@ -1999,7 +1972,6 @@ bool LLAppViewer::cleanup()
pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
pending += LLVFSThread::updateClass(0);
pending += LLLFSThread::updateClass(0);
- pending += LLCurl::getCurlThread()->update(1) ;
F64 idle_time = idleTimer.getElapsedTimeF64();
if(!pending)
{
@@ -2011,7 +1983,6 @@ bool LLAppViewer::cleanup()
break;
}
}
- LLCurl::getCurlThread()->pause() ;
// Delete workers first
// shotdown all worker threads before deleting them in case of co-dependencies
@@ -2026,17 +1997,9 @@ bool LLAppViewer::cleanup()
LL_INFOS() << "Shutting down message system" << LL_ENDL;
end_messaging_system();
- // *NOTE:Mani - The following call is not thread safe.
- LL_CHECK_MEMORY
- LLCurl::cleanupClass();
- LL_CHECK_MEMORY
-
// Non-LLCurl libcurl library
mAppCoreHttp.cleanup();
- // NOTE The following call is not thread safe.
- ll_cleanup_ares();
-
LLFilePickerThread::cleanupClass();
//MUST happen AFTER LLCurl::cleanupClass
@@ -2122,6 +2085,7 @@ bool LLAppViewer::cleanup()
}
LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL;
LLProxy::cleanupClass();
+ LLCore::LLHttp::cleanup();
LLWearableType::cleanupClass();
@@ -4717,31 +4681,6 @@ void LLAppViewer::saveNameCache()
}
-void LLAppViewer::saveExperienceCache()
-{
- std::string filename =
- gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "experience_cache.xml");
- LL_INFOS("ExperienceCache") << "Saving " << filename << LL_ENDL;
- llofstream cache_stream(filename.c_str());
- if(cache_stream.is_open())
- {
- LLExperienceCache::exportFile(cache_stream);
- }
-}
-
-void LLAppViewer::loadExperienceCache()
-{
- std::string filename =
- gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "experience_cache.xml");
- LL_INFOS("ExperienceCache") << "Loading " << filename << LL_ENDL;
- llifstream cache_stream(filename.c_str());
- if(cache_stream.is_open())
- {
- LLExperienceCache::importFile(cache_stream);
- }
-}
-
-
/*! @brief This class is an LLFrameTimer that can be created with
an elapsed time that starts counting up from the given value
rather than 0.0.
@@ -4937,7 +4876,6 @@ void LLAppViewer::idle()
// floating throughout the various object lists.
//
idleNameCache();
- idleExperienceCache();
idleNetwork();
@@ -5368,22 +5306,6 @@ void LLAppViewer::idleNameCache()
LLAvatarNameCache::idle();
}
-void LLAppViewer::idleExperienceCache()
-{
- LLViewerRegion* region = gAgent.getRegion();
- if (!region) return;
-
- std::string lookup_url=region->getCapability("GetExperienceInfo");
- if(!lookup_url.empty() && *lookup_url.rbegin() != '/')
- {
- lookup_url += '/';
- }
-
- LLExperienceCache::setLookupURL(lookup_url);
-
- LLExperienceCache::idle();
-}
-
//
// Handle messages, and all message related stuff
//
@@ -5546,7 +5468,9 @@ void LLAppViewer::disconnectViewer()
}
saveNameCache();
- saveExperienceCache();
+ LLExperienceCache *expCache = LLExperienceCache::getIfExists();
+ if (expCache)
+ expCache->cleanup();
// close inventory interface, close all windows
LLFloaterInventory::cleanup();