From 304e2b4958a571cff74572be3826530f696eca7f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 26 Apr 2013 16:47:22 +0200 Subject: [PATCH] Pass LLControlGroup* to AICurlInterface::startCurlThread instead of each Debug Setting separately. --- indra/llcrashlogger/llcrashlogger.cpp | 8 +-- indra/llmessage/aicurl.h | 6 +- indra/llmessage/aicurlthread.cpp | 12 ++-- .../app_settings/settings_crash_behavior.xml | 55 +++++++++++++++---- indra/newview/llappviewer.cpp | 4 +- 5 files changed, 61 insertions(+), 24 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 20fde21f8..e072b5c79 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -390,11 +390,6 @@ bool LLCrashLogger::init() // Start state machine thread. startEngineThread(); - // Start curl thread. - AICurlInterface::startCurlThread(64, // CurlMaxTotalConcurrentConnections - 8, // CurlConcurrentConnectionsPerService - true); // NoVerifySSLCert - // We assume that all the logs we're looking for reside on the current drive gDirUtilp->initAppDirs("SecondLife"); @@ -414,6 +409,9 @@ bool LLCrashLogger::init() return false; } + // Start curl thread. + AICurlInterface::startCurlThread(&mCrashSettings); + gServicePump = new LLPumpIO; //If we've opened the crash logger, assume we can delete the marker file if it exists diff --git a/indra/llmessage/aicurl.h b/indra/llmessage/aicurl.h index bc97e498f..48fb38ac0 100644 --- a/indra/llmessage/aicurl.h +++ b/indra/llmessage/aicurl.h @@ -61,6 +61,7 @@ class LLSD; class LLBufferArray; class LLChannelDescriptors; class AIHTTPTimeoutPolicy; +class LLControlGroup; // Some pretty printing for curl easy handle related things: // Print the lock object related to the current easy handle in every debug output. @@ -163,7 +164,7 @@ bool handleNoVerifySSLCert(LLSD const& newvalue); void initCurl(void); // Called once at start of application (from LLAppViewer::initThreads), starts AICurlThread. -void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentConnectionsPerService, bool NoVerifySSLCert); +void startCurlThread(LLControlGroup* control_group); // Called once at the end of application before terminating other threads (most notably the texture thread workers) // with the purpose to stop the curl thread from doing any call backs to running responders: the responders sometimes @@ -200,6 +201,9 @@ U32 getNumHTTPAdded(void); // Returns the number of active curl easy handles (that are actually attempting to download something). U32 getNumHTTPRunning(void); +// Cache for gSavedSettings so we have access from llmessage. +extern LLControlGroup* sConfigGroup; + } // namespace AICurlInterface // Forward declaration (see aicurlprivate.h). diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index a7b0e4642..f8aad0887 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -37,6 +37,7 @@ #include "lltimer.h" // ms_sleep, get_clock_count #include "llhttpstatuscodes.h" #include "llbuffer.h" +#include "llcontrol.h" #include #if !LL_WINDOWS #include @@ -2497,7 +2498,9 @@ void AICurlEasyRequest::removeRequest(void) namespace AICurlInterface { -void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentConnectionsPerService, bool NoVerifySSLCert) +LLControlGroup* sConfigGroup; + +void startCurlThread(LLControlGroup* control_group) { using namespace AICurlPrivate; using namespace AICurlPrivate::curlthread; @@ -2505,9 +2508,10 @@ void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentCo llassert(is_main_thread()); // Cache Debug Settings. - curl_max_total_concurrent_connections = CurlMaxTotalConcurrentConnections; - curl_concurrent_connections_per_service = CurlConcurrentConnectionsPerService; - gNoVerifySSLCert = NoVerifySSLCert; + sConfigGroup = control_group; + curl_max_total_concurrent_connections = sConfigGroup->getU32("CurlMaxTotalConcurrentConnections"); + curl_concurrent_connections_per_service = sConfigGroup->getU32("CurlConcurrentConnectionsPerService"); + gNoVerifySSLCert = sConfigGroup->getBOOL("NoVerifySSLCert"); max_pipelined_requests = curl_max_total_concurrent_connections; max_pipelined_requests_per_service = curl_concurrent_connections_per_service; diff --git a/indra/newview/app_settings/settings_crash_behavior.xml b/indra/newview/app_settings/settings_crash_behavior.xml index f588db5cb..433583bee 100644 --- a/indra/newview/app_settings/settings_crash_behavior.xml +++ b/indra/newview/app_settings/settings_crash_behavior.xml @@ -1,15 +1,48 @@ - + CrashSubmitBehavior - - Comment - Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report) - Persist - 2 - Type - S32 - Value - 2 - + + Comment + Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report) + Persist + 2 + Type + S32 + Value + 2 + CurlMaxTotalConcurrentConnections + + Comment + Maximum total number of simultaneous curl connections + Persist + 1 + Type + U32 + Value + 64 + + CurlConcurrentConnectionsPerService + + Comment + Maximum number of simultaneous curl connections per host:port service + Persist + 0 + Type + U32 + Value + 16 + + NoVerifySSLCert + + Comment + Do not verify SSL certificates. + Persist + 1 + Type + Boolean + Value + 1 + + diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c360a03bb..07ae74f6b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1895,9 +1895,7 @@ bool LLAppViewer::initThreads() // State machine thread. startEngineThread(); - AICurlInterface::startCurlThread(gSavedSettings.getU32("CurlMaxTotalConcurrentConnections"), - gSavedSettings.getU32("CurlConcurrentConnectionsPerService"), - gSavedSettings.getBOOL("NoVerifySSLCert")); + AICurlInterface::startCurlThread(&gSavedSettings); LLImage::initClass();