diff options
author | Thomas Nelson <rider@lindenlab.com> | 2017-10-17 13:38:39 -0700 |
---|---|---|
committer | Thomas Nelson <rider@lindenlab.com> | 2017-10-17 13:38:39 -0700 |
commit | 5754493cdcfeac76d0576abc19bdf5a03717780d (patch) | |
tree | e6db53ae1cd654f9b2a1a6b9ab47e01ea738ecef /indra/llcorehttp/_httppolicy.cpp | |
parent | cc22ffc6d799544e8f2a9dfed6813081d908c88d (diff) | |
parent | 9c5becd67d7e6fe5f696dcae8690dd562b7b0449 (diff) |
Merged lindenlab/viewer64 into default
Diffstat (limited to 'indra/llcorehttp/_httppolicy.cpp')
-rw-r--r-- | indra/llcorehttp/_httppolicy.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index a302db8b46..885f0ed61d 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -152,20 +152,16 @@ void HttpPolicy::addOp(const HttpOpRequest::ptr_t &op) void HttpPolicy::retryOp(const HttpOpRequest::ptr_t &op) { - static const HttpTime retry_deltas[] = - { - 250000, // 1st retry in 0.25 S, etc... - 500000, - 1000000, - 2000000, - 5000000 // ... to every 5.0 S. - }; - 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)]); + + HttpTime delta_min = op->mPolicyMinRetryBackoff; + HttpTime delta_max = op->mPolicyMaxRetryBackoff; + // mPolicyRetries limited to 100 + U32 delta_factor = op->mPolicyRetries <= 10 ? 1 << op->mPolicyRetries : 1024; + HttpTime delta = llmin(delta_min * delta_factor, delta_max); bool external_delta(false); if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30) |