Pass LLControlGroup* to AICurlInterface::startCurlThread instead of each Debug Setting separately.

This commit is contained in:
Aleric Inglewood
2013-04-26 16:47:22 +02:00
parent fb2f0dd164
commit 304e2b4958
5 changed files with 61 additions and 24 deletions

View File

@@ -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

View File

@@ -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).

View File

@@ -37,6 +37,7 @@
#include "lltimer.h" // ms_sleep, get_clock_count
#include "llhttpstatuscodes.h"
#include "llbuffer.h"
#include "llcontrol.h"
#include <sys/types.h>
#if !LL_WINDOWS
#include <sys/select.h>
@@ -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;

View File

@@ -1,15 +1,48 @@
<llsd>
<map>
<map>
<key>CrashSubmitBehavior</key>
<map>
<key>Comment</key>
<string>Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)</string>
<key>Persist</key>
<integer>2</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>2</integer>
</map>
<map>
<key>Comment</key>
<string>Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)</string>
<key>Persist</key>
<integer>2</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>2</integer>
</map>
<key>CurlMaxTotalConcurrentConnections</key>
<map>
<key>Comment</key>
<string>Maximum total number of simultaneous curl connections</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>64</integer>
</map>
<key>CurlConcurrentConnectionsPerService</key>
<map>
<key>Comment</key>
<string>Maximum number of simultaneous curl connections per host:port service</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>16</integer>
</map>
<key>NoVerifySSLCert</key>
<map>
<key>Comment</key>
<string>Do not verify SSL certificates.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
</map>
</llsd>

View File

@@ -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();