summaryrefslogtreecommitdiff
path: root/indra/newview/llhttpretrypolicy.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-15 11:16:27 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-15 11:16:27 +0300
commitbccc10db9a90d365c353baebf443fde2030ce970 (patch)
tree2c2e1fd94b29667a809f8d7285d049f5ff5d424d /indra/newview/llhttpretrypolicy.h
parent531cd34f670170ade57f8813fe48012b61a1d3c2 (diff)
parentbb3c36f5cbc0c3b542045fd27255eee24e03da22 (diff)
Merge branch 'main' into marchcat/x-b-merge
# Conflicts: # autobuild.xml # indra/cmake/ConfigurePkgConfig.cmake # indra/cmake/ICU4C.cmake # indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp # indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h # indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h # indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp # indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h # indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp # indra/newview/llappviewerlinux_api.h # indra/newview/llappviewerlinux_api_dbus.cpp # indra/newview/llappviewerlinux_api_dbus.h # indra/newview/llfloateremojipicker.cpp # indra/newview/lloutfitslist.cpp
Diffstat (limited to 'indra/newview/llhttpretrypolicy.h')
-rw-r--r--indra/newview/llhttpretrypolicy.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h
index af07b4afec..59bcc07848 100644
--- a/indra/newview/llhttpretrypolicy.h
+++ b/indra/newview/llhttpretrypolicy.h
@@ -1,29 +1,29 @@
-/**
+/**
* @file file llhttpretrypolicy.h
* @brief declarations for http retry policy class.
*
* $LicenseInfo:firstyear=2013&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2013, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
#ifndef LL_RETRYPOLICY_H
#define LL_RETRYPOLICY_H
@@ -41,20 +41,20 @@
class LLHTTPRetryPolicy: public LLThreadSafeRefCount
{
public:
- LLHTTPRetryPolicy() {}
+ LLHTTPRetryPolicy() {}
- virtual ~LLHTTPRetryPolicy() {}
- // Call after a sucess to reset retry state.
+ 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;
+ virtual void onSuccess() = 0;
+ // Call once after an HTTP failure to update state.
+ virtual void onFailure(S32 status, const LLSD& headers) = 0;
- virtual void onFailure(const LLCore::HttpResponse *response) = 0;
+ virtual void onFailure(const LLCore::HttpResponse *response) = 0;
- virtual bool shouldRetry(F32& seconds_to_wait) const = 0;
+ virtual bool shouldRetry(F32& seconds_to_wait) const = 0;
- virtual void reset() = 0;
+ virtual void reset() = 0;
};
// Very general policy with geometric back-off after failures,
@@ -62,39 +62,39 @@ public:
class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy
{
public:
- LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false);
+ LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false);
+
+ // virtual
+ void onSuccess();
- // virtual
- void onSuccess();
+ void reset();
- void reset();
-
- // virtual
- void onFailure(S32 status, const LLSD& headers);
- // virtual
- void onFailure(const LLCore::HttpResponse *response);
- // virtual
- bool shouldRetry(F32& seconds_to_wait) const;
+ // virtual
+ void onFailure(S32 status, const LLSD& headers);
+ // virtual
+ void onFailure(const LLCore::HttpResponse *response);
+ // virtual
+ bool shouldRetry(F32& seconds_to_wait) const;
static bool getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait);
protected:
- void init();
- bool getRetryAfter(const LLSD& headers, F32& retry_header_time);
- bool getRetryAfter(const LLCore::HttpHeaders::ptr_t &headers, F32& retry_header_time);
- void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time);
+ void init();
+ bool getRetryAfter(const LLSD& headers, F32& retry_header_time);
+ bool getRetryAfter(const LLCore::HttpHeaders::ptr_t &headers, F32& retry_header_time);
+ void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time);
private:
- 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.
- bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc.
- bool mRetryOn4xx; // Normally only retry on 5xx server errors.
+ 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.
+ bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc.
+ bool mRetryOn4xx; // Normally only retry on 5xx server errors.
};
#endif