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

Unified Diff: net/proxy/proxy_list.cc

Issue 1191823002: Allow for an existing bad proxy to be given a new retry delay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary blank line 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 5574f0162cfdae95140605e73993a2d0ed2735ae..7d53b4cfb7ebd485eaada9d0096bfe012677bec1 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.
mmenke 2015/06/18 22:25:06 Wow...This is a bug ID from before Chrome was open
- 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;
mmenke 2015/06/18 22:25:06 Seems like changing this could have unexpected sid
sclittle 2015/06/19 01:45:10 I see your point. Although I do think that this lo
mmenke 2015/06/19 15:15:56 Or could overwrite the old try_while_bad value if
sclittle 2015/06/19 19:55:36 Sure, let's wait for eroman then. I've added him a
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