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

Unified Diff: libcurl_http_fetcher.h

Issue 3010009: AU: When server dies, don't retry forever (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: fixes for review, cleanup some LOG messages Created 10 years, 5 months 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
Index: libcurl_http_fetcher.h
diff --git a/libcurl_http_fetcher.h b/libcurl_http_fetcher.h
index fd55d8e683dc2c02f1fd88baf8022f6b6e17a4f8..a7799cb007eb4a64b8ec0ff7320d57e5432420d0 100644
--- a/libcurl_http_fetcher.h
+++ b/libcurl_http_fetcher.h
@@ -23,7 +23,7 @@ class LibcurlHttpFetcher : public HttpFetcher {
LibcurlHttpFetcher()
: curl_multi_handle_(NULL), curl_handle_(NULL),
timeout_source_(NULL), transfer_in_progress_(false),
- idle_ms_(1000) {}
+ retry_count_(0), idle_ms_(1000) {}
// Cleans up all internal state. Does not notify delegate
~LibcurlHttpFetcher();
@@ -73,6 +73,11 @@ class LibcurlHttpFetcher : public HttpFetcher {
static gboolean StaticTimeoutCallback(gpointer data) {
return reinterpret_cast<LibcurlHttpFetcher*>(data)->TimeoutCallback();
}
+
+ gboolean RetryTimeoutCallback();
+ static gboolean StaticRetryTimeoutCallback(void* arg) {
+ return static_cast<LibcurlHttpFetcher*>(arg)->RetryTimeoutCallback();
+ }
// Calls into curl_multi_perform to let libcurl do its work. Returns after
// curl_multi_perform is finished, which may actually be after more than
@@ -123,6 +128,9 @@ class LibcurlHttpFetcher : public HttpFetcher {
// If we resumed an earlier transfer, data offset that we used for the
// new connection. 0 otherwise.
off_t resume_offset_;
+
+ // Number of resumes performed.
+ int retry_count_;
long idle_ms_;
DISALLOW_COPY_AND_ASSIGN(LibcurlHttpFetcher);
« no previous file with comments | « http_fetcher_unittest.cc ('k') | libcurl_http_fetcher.cc » ('j') | libcurl_http_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698