summaryrefslogtreecommitdiff
path: root/indra/newview/llhttpretrypolicy.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2013-04-16 20:27:49 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2013-04-16 20:27:49 -0400
commite3bad9fb86c3f44ad67488402ce2e46743a2422e (patch)
treefee6f93203d87d71031de5df7181cd7df9ca88ce /indra/newview/llhttpretrypolicy.h
parent9cbbb45a0ca8a56707125cdb3f6ea95de7f9deef (diff)
SH-4061 WIP - fix for build issues on mac, reset the retry policy on success.
Diffstat (limited to 'indra/newview/llhttpretrypolicy.h')
-rwxr-xr-xindra/newview/llhttpretrypolicy.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h
index 6f63f047de..1fb0cac03f 100755
--- a/indra/newview/llhttpretrypolicy.h
+++ b/indra/newview/llhttpretrypolicy.h
@@ -42,7 +42,11 @@ class LLHTTPRetryPolicy: public LLThreadSafeRefCount
{
public:
LLHTTPRetryPolicy() {}
+
virtual ~LLHTTPRetryPolicy() {}
+ // Call after a sucess to reset retry state.
+
+ virtual void onSuccess() = 0;
// Call once after an HTTP failure to update state.
virtual void onFailure(S32 status, const LLSD& headers) = 0;
@@ -59,6 +63,9 @@ public:
LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries);
// virtual
+ void onSuccess();
+
+ // virtual
void onFailure(S32 status, const LLSD& headers);
// virtual
void onFailure(const LLCore::HttpResponse *response);
@@ -66,16 +73,17 @@ public:
bool shouldRetry(F32& seconds_to_wait) const;
protected:
+ void init();
bool getRetryAfter(const LLSD& headers, F32& retry_header_time);
bool getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time);
void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time);
private:
- F32 mMinDelay; // delay never less than this value
- F32 mMaxDelay; // delay never exceeds this value
- F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay.
- U32 mMaxRetries; // maximum number of times shouldRetry will return true.
+ const F32 mMinDelay; // delay never less than this value
+ const F32 mMaxDelay; // delay never exceeds this value
+ const F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay.
+ const U32 mMaxRetries; // maximum number of times shouldRetry will return true.
F32 mDelay; // current default delay.
U32 mRetryCount; // number of times shouldRetry has been called.
LLTimer mRetryTimer; // time until next retry.