diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2012-06-22 19:13:50 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2012-06-22 19:13:50 -0400 |
commit | bc7d5b24d16963a2715e880c518a4706a99f02fa (patch) | |
tree | db91cb215ecf88fa57bbe599cba9df699fd46334 /indra/llcorehttp/_httpservice.cpp | |
parent | 5ff1758b633f1984f601aacbb7920c3c744b87f7 (diff) |
This sets down the groundwork for dynamic policy classes.
Groundwork is used for the default class which currently represents
texture fetching. Class options implemented from API user into
HttpLibcurl. Policy layer is going to start doing some traffic
shaping like work to solve problems with consumer-grade gear.
Need to have dynamic aspects to policies and that starts now...
Diffstat (limited to 'indra/llcorehttp/_httpservice.cpp')
-rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index faafd9a6c7..9c5c7bf9b4 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -53,6 +53,12 @@ HttpService::HttpService() mPolicy(NULL), mTransport(NULL) { + HttpPolicyClass pol_class; + pol_class.set(HttpRequest::CP_CONNECTION_LIMIT, DEFAULT_CONNECTIONS); + pol_class.set(HttpRequest::CP_PER_HOST_CONNECTION_LIMIT, DEFAULT_CONNECTIONS); + pol_class.set(HttpRequest::CP_ENABLE_PIPELINING, 0L); + + mPolicyClasses.push_back(pol_class); } @@ -114,6 +120,18 @@ void HttpService::term() } +HttpRequest::policy_t HttpService::createPolicyClass() +{ + const HttpRequest::policy_t policy_class(mPolicyClasses.size()); + if (policy_class >= POLICY_CLASS_LIMIT) + { + return 0; + } + mPolicyClasses.push_back(HttpPolicyClass()); + return policy_class; +} + + bool HttpService::isStopped() { // What is really wanted here is something like: @@ -142,7 +160,8 @@ void HttpService::startThread() } // Push current policy definitions - mPolicy->setPolicies(mPolicyGlobal); + mPolicy->setPolicies(mPolicyGlobal, mPolicyClasses); + mTransport->setPolicyCount(mPolicyClasses.size()); mThread = new LLCoreInt::HttpThread(boost::bind(&HttpService::threadRun, this, _1)); mThread->addRef(); // Need an explicit reference, implicit one is used internally |