summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httppolicy.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2013-08-22 19:53:46 -0400
committerMonty Brandenberg <monty@lindenlab.com>2013-08-22 19:53:46 -0400
commit98e5d24b56dd9e948ff8df000da93891af9f7899 (patch)
tree83137b98195b27c772a820fd7f9bffb2626d5817 /indra/llcorehttp/_httppolicy.cpp
parentc4cda389afbfb4969e6705bdf4ba1cd3479f5cfd (diff)
parent146a5c3f6c3d1b8e9e92f71dce1e7f058091ea20 (diff)
Automated merge with ssh://hg.lindenlab.com/monty/viewer-drano-http-3
Diffstat (limited to 'indra/llcorehttp/_httppolicy.cpp')
-rwxr-xr-xindra/llcorehttp/_httppolicy.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp
index 808eebc6cc..ac79a77659 100755
--- a/indra/llcorehttp/_httppolicy.cpp
+++ b/indra/llcorehttp/_httppolicy.cpp
@@ -153,14 +153,16 @@ void HttpPolicy::retryOp(HttpOpRequest * op)
};
static const int delta_max(int(LL_ARRAY_SIZE(retry_deltas)) - 1);
static const HttpStatus error_503(503);
-
+
const HttpTime now(totalTime());
const int policy_class(op->mReqPolicy);
HttpTime delta(retry_deltas[llclamp(op->mPolicyRetries, 0, delta_max)]);
+ bool external_delta(false);
if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30)
{
delta = op->mReplyRetryAfter * U64L(1000000);
+ external_delta = true;
}
op->mPolicyRetryAt = now + delta;
++op->mPolicyRetries;
@@ -171,7 +173,8 @@ void HttpPolicy::retryOp(HttpOpRequest * op)
LL_DEBUGS("CoreHttp") << "HTTP request " << static_cast<HttpHandle>(op)
<< " retry " << op->mPolicyRetries
<< " scheduled in " << (delta / HttpTime(1000))
- << " mS. Status: " << op->mStatus.toHex()
+ << " mS (" << (external_delta ? "external" : "internal")
+ << "). Status: " << op->mStatus.toHex()
<< LL_ENDL;
if (op->mTracing > HTTP_TRACE_OFF)
{
@@ -212,6 +215,14 @@ HttpService::ELoopSpeed HttpPolicy::processReadyQueue()
for (int policy_class(0); policy_class < mClasses.size(); ++policy_class)
{
ClassState & state(*mClasses[policy_class]);
+ HttpRetryQueue & retryq(state.mRetryQueue);
+ HttpReadyQueue & readyq(state.mReadyQueue);
+
+ if (retryq.empty() && readyq.empty())
+ {
+ continue;
+ }
+
const bool throttle_enabled(state.mOptions.mThrottleRate > 0L);
const bool throttle_current(throttle_enabled && now < state.mThrottleEnd);
@@ -225,9 +236,6 @@ HttpService::ELoopSpeed HttpPolicy::processReadyQueue()
int active(transport.getActiveCountInClass(policy_class));
int needed(state.mOptions.mConnectionLimit - active); // Expect negatives here
- HttpRetryQueue & retryq(state.mRetryQueue);
- HttpReadyQueue & readyq(state.mReadyQueue);
-
if (needed > 0)
{
// First see if we have any retries...