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

Unified Diff: libcurl_http_fetcher.cc

Issue 3187005: Increase retry timeout to 1 minute. (Closed) Base URL: http://src.chromium.org/git/update_engine.git
Patch Set: Created 10 years, 4 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
« no previous file with comments | « libcurl_http_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libcurl_http_fetcher.cc
diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
index 0707d999689b89429bd885b1d0503ae314a7908c..f63676432e1ea9694dba1fca507d2c02b7489f9b 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -112,7 +112,7 @@ void LibcurlHttpFetcher::CurlPerformOnce() {
if (delegate_)
delegate_->TransferComplete(this, false); // success
} else {
- g_timeout_add_seconds(5,
+ g_timeout_add_seconds(retry_seconds_,
&LibcurlHttpFetcher::StaticRetryTimeoutCallback,
this);
}
@@ -216,29 +216,12 @@ void LibcurlHttpFetcher::SetupMainloopSources() {
}
}
- // Wet up a timeout callback for libcurl
- long ms = 0;
- CHECK_EQ(curl_multi_timeout(curl_multi_handle_, &ms), CURLM_OK);
- if (ms < 0) {
- // From http://curl.haxx.se/libcurl/c/curl_multi_timeout.html:
- // if libcurl returns a -1 timeout here, it just means that libcurl
- // currently has no stored timeout value. You must not wait too long
- // (more than a few seconds perhaps) before you call
- // curl_multi_perform() again.
- ms = idle_ms_;
- }
+ // Set up a timeout callback for libcurl.
if (!timeout_source_) {
- LOG(INFO) << "setting up timeout source:" << ms;
- timeout_source_ = g_timeout_source_new_seconds(1);
- CHECK(timeout_source_);
- g_source_set_callback(timeout_source_, StaticTimeoutCallback, this,
- NULL);
+ LOG(INFO) << "Setting up timeout source: " << idle_seconds_ << " seconds.";
+ timeout_source_ = g_timeout_source_new_seconds(idle_seconds_);
+ g_source_set_callback(timeout_source_, StaticTimeoutCallback, this, NULL);
g_source_attach(timeout_source_, NULL);
- static int counter = 0;
- counter++;
- if (counter % 50 == 0) {
- LOG(INFO) << "counter = " << counter;
- }
}
}
« no previous file with comments | « libcurl_http_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698