Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2452)

Unified Diff: libcurl_http_fetcher.h

Issue 5260004: AU: Retry up to 3 times 30 seconds apart on HTTP response code 0. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: address review comments Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | libcurl_http_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libcurl_http_fetcher.h
diff --git a/libcurl_http_fetcher.h b/libcurl_http_fetcher.h
index c41804e38703744bd3b0a594c1c77541ed972897..c5f784b05e637ecc65f62bc1e5d454f700fc11c0 100644
--- a/libcurl_http_fetcher.h
+++ b/libcurl_http_fetcher.h
@@ -33,6 +33,8 @@ class LibcurlHttpFetcher : public HttpFetcher {
resume_offset_(0),
retry_count_(0),
retry_seconds_(60),
+ no_network_retry_count_(0),
+ no_network_max_retries_(0),
idle_seconds_(1),
force_connection_type_(false),
forced_expensive_connection_(false),
@@ -74,6 +76,10 @@ class LibcurlHttpFetcher : public HttpFetcher {
// Sets the retry timeout. Useful for testing.
void set_retry_seconds(int seconds) { retry_seconds_ = seconds; }
+ void set_no_network_max_retries(int retries) {
+ no_network_max_retries_ = retries;
+ }
+
void SetConnectionAsExpensive(bool is_expensive) {
force_connection_type_ = true;
forced_expensive_connection_ = is_expensive;
@@ -185,6 +191,10 @@ class LibcurlHttpFetcher : public HttpFetcher {
// Seconds to wait before retrying a resume.
int retry_seconds_;
+ // Number of resumes due to no network (e.g., HTTP response code 0).
+ int no_network_retry_count_;
+ int no_network_max_retries_;
+
// Seconds to wait before asking libcurl to "perform".
int idle_seconds_;
@@ -200,7 +210,7 @@ class LibcurlHttpFetcher : public HttpFetcher {
// If true, we are currently performing a write callback on the delegate.
bool in_write_callback_;
-
+
// If true, we have returned at least one byte in the write callback
// to the delegate.
bool sent_byte_;
« no previous file with comments | « no previous file | libcurl_http_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698