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

Unified Diff: libcurl_http_fetcher.cc

Issue 6516026: AU: Make proxy resolution asynchronous. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fix utils.* include paths Created 9 years, 10 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') | proxy_resolver.h » ('j') | 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 16d02392ea9b594ba602b04fbd5abdcff0d5b39e..e46bf8e5d7dab99d064be04d3a7d213ee34e761d 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -14,6 +14,7 @@
#include "update_engine/flimflam_proxy.h"
#include "update_engine/utils.h"
+using google::protobuf::NewCallback;
using std::max;
using std::make_pair;
using std::string;
@@ -151,14 +152,25 @@ void LibcurlHttpFetcher::ResumeTransfer(const std::string& url) {
// Begins the transfer, which must not have already been started.
void LibcurlHttpFetcher::BeginTransfer(const std::string& url) {
+ CHECK(!transfer_in_progress_);
+ url_ = url;
+ if (!ResolveProxiesForUrl(
+ url_,
+ NewCallback(this, &LibcurlHttpFetcher::ProxiesResolved))) {
+ LOG(ERROR) << "Couldn't resolve proxies";
+ if (delegate_)
+ delegate_->TransferComplete(this, false);
+ }
+}
+
+void LibcurlHttpFetcher::ProxiesResolved() {
transfer_size_ = -1;
resume_offset_ = 0;
retry_count_ = 0;
no_network_retry_count_ = 0;
http_response_code_ = 0;
terminate_requested_ = false;
- ResolveProxiesForUrl(url);
- ResumeTransfer(url);
+ ResumeTransfer(url_);
CurlPerformOnce();
}
« no previous file with comments | « libcurl_http_fetcher.h ('k') | proxy_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698