diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-05-10 16:09:25 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-05-10 16:09:25 +0300 |
commit | b1243c55e5579f72e3dd9dafe2b53173349a047f (patch) | |
tree | 9d9e0b018059483973a8e6f76644b0875d2534a3 /indra/newview/llappviewer.cpp | |
parent | 042930b59a82f706f16e4b67a683697aed65112f (diff) | |
parent | 7f5e6cea124e1193b199a3eabd50bdab96340c13 (diff) |
Merged in oz_linden/maint-5974
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rwxr-xr-x | indra/newview/llappviewer.cpp | 140 |
1 files changed, 35 insertions, 105 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1887adc97e..cd264bfe2c 100755 --- 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" @@ -231,7 +229,7 @@ #include "llmachineid.h" #include "llmainlooprepeater.h" - +#include "llcoproceduremanager.h" #include "llviewereventrecorder.h" @@ -761,8 +759,11 @@ void fast_exit(int rc) { _exit(rc); } + + } + bool LLAppViewer::init() { setupErrorHandling(mSecondInstance); @@ -831,12 +832,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(); @@ -906,7 +902,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 @@ -1163,8 +1159,6 @@ bool LLAppViewer::init() { LLNotificationsUtil::add("CorruptedProtectedDataStore"); } - LLHTTPClient::setCertVerifyCallback(secapiSSLCertVerifyCallback); - gGLActive = FALSE; @@ -1222,6 +1216,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; } @@ -1288,7 +1288,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"); @@ -1312,8 +1311,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. @@ -1432,26 +1429,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(); } @@ -1558,11 +1535,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(); @@ -1803,13 +1775,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; @@ -2003,7 +1976,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) { @@ -2015,7 +1987,6 @@ bool LLAppViewer::cleanup() break; } } - LLCurl::getCurlThread()->pause() ; // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies @@ -2030,17 +2001,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 @@ -2126,6 +2089,7 @@ bool LLAppViewer::cleanup() } LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL; LLProxy::cleanupClass(); + LLCore::LLHttp::cleanup(); LLWearableType::cleanupClass(); @@ -2795,7 +2759,7 @@ bool LLAppViewer::initConfiguration() // gWindowTitle = LLTrans::getString("APP_NAME"); #if LL_DEBUG - gWindowTitle += std::string(" [DEBUG]"); + gWindowTitle += std::string(" [DEBUG]"); #endif if (!gArgs.empty()) { @@ -3367,7 +3331,7 @@ LLSD LLAppViewer::getViewerInfo() const #endif info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION)); - info["LIBCURL_VERSION"] = LLCurl::getVersionString(); + info["LIBCURL_VERSION"] = LLCore::LLHttp::getCURLVersion(); info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); bool want_fullname = true; info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD(); @@ -3654,9 +3618,9 @@ void getFileList() void LLAppViewer::handleViewerCrash() { - LL_INFOS() << "Handle viewer crash entry." << LL_ENDL; + LL_INFOS("CRASHREPORT") << "Handle viewer crash entry." << LL_ENDL; - LL_INFOS() << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ; + LL_INFOS("CRASHREPORT") << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ; LLMemory::logMemoryInfo(true) ; @@ -3764,30 +3728,36 @@ void LLAppViewer::handleViewerCrash() #endif char *minidump_file = pApp->getMiniDumpFilename(); - + LL_DEBUGS("CRASHREPORT") << "minidump file name " << minidump_file << LL_ENDL; if(minidump_file && minidump_file[0] != 0) { gDebugInfo["Dynamic"]["MinidumpPath"] = minidump_file; } -#ifdef LL_WINDOWS else { +#ifdef LL_WINDOWS getFileList(); +#else + LL_WARNS("CRASHREPORT") << "no minidump file?" << LL_ENDL; +#endif } -#endif gDebugInfo["Dynamic"]["CrashType"]="crash"; if (gMessageSystem && gDirUtilp) { std::string filename; filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log"); + LL_DEBUGS("CRASHREPORT") << "recording stats " << filename << LL_ENDL; llofstream file(filename.c_str(), std::ios_base::binary); if(file.good()) { - LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL; gMessageSystem->summarizeLogs(file); file.close(); } + else + { + LL_WARNS("CRASHREPORT") << "problem recording stats" << LL_ENDL; + } } if (gMessageSystem) @@ -4722,31 +4692,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. @@ -4942,7 +4887,6 @@ void LLAppViewer::idle() // floating throughout the various object lists. // idleNameCache(); - idleExperienceCache(); idleNetwork(); @@ -5373,22 +5317,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 // @@ -5551,7 +5479,9 @@ void LLAppViewer::disconnectViewer() } saveNameCache(); - saveExperienceCache(); + LLExperienceCache *expCache = LLExperienceCache::getIfExists(); + if (expCache) + expCache->cleanup(); // close inventory interface, close all windows LLFloaterInventory::cleanup(); |