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

Unified Diff: http_fetcher.cc

Issue 6693047: AU: HttpFetcher: Fix segfault with multi fetcher and small transfers (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Created 9 years, 9 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 | « no previous file | multi_range_http_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: http_fetcher.cc
diff --git a/http_fetcher.cc b/http_fetcher.cc
index 7d9297a5048938fc8b2e6e11b9cc15fcde14e6a9..9e1e0aca38e038237ed389b73fa7bc8499a11ba6 100644
--- a/http_fetcher.cc
+++ b/http_fetcher.cc
@@ -31,6 +31,7 @@ bool HttpFetcher::ResolveProxiesForUrl(const string& url, Closure* callback) {
no_resolver_idle_id_ = g_idle_add(utils::GlibRunClosure, callback);
return true;
}
+ CHECK_EQ(reinterpret_cast<Closure*>(NULL), callback_);
callback_ = callback;
return proxy_resolver_->GetProxiesForUrl(url,
&HttpFetcher::StaticProxiesResolved,
@@ -41,8 +42,11 @@ void HttpFetcher::ProxiesResolved(const std::deque<std::string>& proxies) {
no_resolver_idle_id_ = 0;
if (!proxies.empty())
SetProxies(proxies);
- callback_->Run();
+ CHECK_NE(reinterpret_cast<Closure*>(NULL), callback_);
+ Closure* callback = callback_;
callback_ = NULL;
+ // This may indirectly call back into ResolveProxiesForUrl():
+ callback->Run();
}
} // namespace chromeos_update_engine
« no previous file with comments | « no previous file | multi_range_http_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698