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

Unified Diff: net/http/http_network_transaction.cc

Issue 10987043: Receiving Connection: Proxy-Bypass induces proxy fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pull proxy list mutation in ProxyService. 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
« no previous file with comments | « no previous file | net/proxy/proxy_info.h » ('j') | net/proxy/proxy_info.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index dd538e27b7e6ba85016deb4b5d98f1280b863a19..6771eb713877664cfa0b7edbb0cefb015a5afdd5 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -862,6 +862,23 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
}
DCHECK(response_.headers);
+ // Server-induced fallback is supported only if this is a PAC configured
+ // proxy.
+ if (response_.was_fetched_via_proxy && proxy_info_.did_use_pac_script()) {
+ if (response_.headers != NULL &&
+ response_.headers->HasHeaderValue("connection", "proxy-bypass")) {
+ ProxyService* proxy_service = session_->proxy_service();
+ if (proxy_service->Fallback(&proxy_info_, net_log_)) {
+ // Only retry in the case of GETs. We don't want to resubmit a POST
+ // if the proxy took some action.
+ if (request_->method == "GET") {
+ ResetConnectionAndRequestForResend();
+ return OK;
+ }
+ }
+ }
+ }
+
// Like Net.HttpResponseCode, but only for MAIN_FRAME loads.
if (request_->load_flags & LOAD_MAIN_FRAME) {
const int response_code = response_.headers->response_code();
« no previous file with comments | « no previous file | net/proxy/proxy_info.h » ('j') | net/proxy/proxy_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698