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

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: 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') | no next file with comments »
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..810b6b168dd7526f0f899a621ea2752ae8aad445 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -862,6 +862,22 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
}
DCHECK(response_.headers);
+ // Server-induced fallback is supported only if this is a PAC configured
eroman 2012/09/26 22:01:58 Can you additionally link to the document you wrot
Michael Piatek 2012/09/27 00:30:24 Added a link to the bug, which has additional cont
+ // 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();
+ // TODO(piatek): const_cast, or non-const accessor?
eroman 2012/09/26 01:36:20 Internalize the mutation of the proxy retry map in
Michael Piatek 2012/09/26 20:13:53 Done. (Although, I think proxy_info_'s list needs
eroman 2012/09/26 22:01:58 The reason I don't want proxy_info_ to be modified
Michael Piatek 2012/09/27 00:30:24 Done. (You're right -- I'm not sure what I was doi
+ ProxyRetryInfoMap& map =
+ const_cast<ProxyRetryInfoMap&>(proxy_service->proxy_retry_info());
+ if (proxy_info_.proxy_list().Fallback(&map, net_log_)) {
+ ResetConnectionAndRequestForResend();
eroman 2012/09/26 01:36:20 I thought your strategy was going to be to have th
Michael Piatek 2012/09/26 20:13:53 If there's no DIRECT option, Fallback() returns fa
eroman 2012/09/26 22:01:58 Ah good point, that resend loop won't be possible
Michael Piatek 2012/09/27 00:30:24 will do
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698