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

Unified Diff: net/proxy/proxy_list.cc

Issue 1212643009: Allow for an existing bad proxy to be given a new retry delay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2403
Patch Set: Created 5 years, 6 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 | net/proxy/proxy_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_list.cc
diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc
index e53fe7ce3fdcb86be5da2d25ecf27895387e634b..99322450f135802d23b026c99f5efa5596922509 100644
--- a/net/proxy/proxy_list.cc
+++ b/net/proxy/proxy_list.cc
@@ -187,16 +187,13 @@ void ProxyList::AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info,
int net_error,
const BoundNetLog& net_log) const {
// Mark this proxy as bad.
+ TimeTicks bad_until = TimeTicks::Now() + retry_delay;
std::string proxy_key = proxy_to_retry.ToURI();
ProxyRetryInfoMap::iterator iter = proxy_retry_info->find(proxy_key);
- if (iter != proxy_retry_info->end()) {
- // TODO(nsylvain): This is not the first time we get this. We should
- // double the retry time. Bug 997660.
- iter->second.bad_until = TimeTicks::Now() + iter->second.current_delay;
- } else {
+ if (iter == proxy_retry_info->end() || bad_until > iter->second.bad_until) {
ProxyRetryInfo retry_info;
retry_info.current_delay = retry_delay;
- retry_info.bad_until = TimeTicks().Now() + retry_info.current_delay;
+ retry_info.bad_until = bad_until;
retry_info.try_while_bad = try_while_bad;
retry_info.net_error = net_error;
(*proxy_retry_info)[proxy_key] = retry_info;
« no previous file with comments | « no previous file | net/proxy/proxy_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698