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

Unified Diff: net/proxy/proxy_list.cc

Issue 10987043: Receiving Connection: Proxy-Bypass induces proxy fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fallback without modifying proxy_list during the transaction. Created 8 years, 3 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
Index: net/proxy/proxy_list.cc
diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc
index 3a63c6cc0eb705ae13e8c72fc351edad370727ec..f092f51cfbf3e521b81198b8e3d2ce3f4c459937 100644
--- a/net/proxy/proxy_list.cc
+++ b/net/proxy/proxy_list.cc
@@ -126,8 +126,6 @@ std::string ProxyList::ToPacString() const {
bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info,
const BoundNetLog& net_log) {
- // Number of minutes to wait before retrying a bad proxy server.
- const TimeDelta kProxyRetryDelay = TimeDelta::FromMinutes(5);
// TODO(eroman): It would be good if instead of removing failed proxies
// from the list, we simply annotated them with the error code they failed
@@ -147,6 +145,22 @@ bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info,
NOTREACHED();
return false;
}
+ UpdateRetryInfoOnFallback(proxy_retry_info, net_log);
+
+ // Remove this proxy from our list.
+ proxies_.erase(proxies_.begin());
+ return !proxies_.empty();
+}
+
+void ProxyList::UpdateRetryInfoOnFallback(
+ ProxyRetryInfoMap* proxy_retry_info, const BoundNetLog& net_log) const {
+ // Number of minutes to wait before retrying a bad proxy server.
+ const TimeDelta kProxyRetryDelay = TimeDelta::FromMinutes(5);
+
+ if (proxies_.empty()) {
+ NOTREACHED();
+ return;
+ }
if (!proxies_[0].is_direct()) {
std::string key = proxies_[0].ToURI();
@@ -165,11 +179,6 @@ bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info,
net_log.AddEvent(NetLog::TYPE_PROXY_LIST_FALLBACK,
NetLog::StringCallback("bad_proxy", &key));
}
-
- // Remove this proxy from our list.
- proxies_.erase(proxies_.begin());
-
- return !proxies_.empty();
}
} // namespace net
« no previous file with comments | « net/proxy/proxy_list.h ('k') | net/proxy/proxy_service.h » ('j') | net/proxy/proxy_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698