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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/proxy/proxy_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 855
856 if (result == ERR_CONNECTION_CLOSED) { 856 if (result == ERR_CONNECTION_CLOSED) {
857 // For now, if we get at least some data, we do the best we can to make 857 // For now, if we get at least some data, we do the best we can to make
858 // sense of it and send it back up the stack. 858 // sense of it and send it back up the stack.
859 int rv = HandleConnectionClosedBeforeEndOfHeaders(); 859 int rv = HandleConnectionClosedBeforeEndOfHeaders();
860 if (rv != OK) 860 if (rv != OK)
861 return rv; 861 return rv;
862 } 862 }
863 DCHECK(response_.headers); 863 DCHECK(response_.headers);
864 864
865 // 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
866 // proxy.
867 if (response_.was_fetched_via_proxy && proxy_info_.did_use_pac_script()) {
868 if (response_.headers != NULL &&
869 response_.headers->HasHeaderValue("connection", "proxy-bypass")) {
870 ProxyService* proxy_service = session_->proxy_service();
871 // 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
872 ProxyRetryInfoMap& map =
873 const_cast<ProxyRetryInfoMap&>(proxy_service->proxy_retry_info());
874 if (proxy_info_.proxy_list().Fallback(&map, net_log_)) {
875 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
876 return OK;
877 }
878 }
879 }
880
865 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads. 881 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads.
866 if (request_->load_flags & LOAD_MAIN_FRAME) { 882 if (request_->load_flags & LOAD_MAIN_FRAME) {
867 const int response_code = response_.headers->response_code(); 883 const int response_code = response_.headers->response_code();
868 UMA_HISTOGRAM_ENUMERATION( 884 UMA_HISTOGRAM_ENUMERATION(
869 "Net.HttpResponseCode_Nxx_MainFrame", response_code/100, 10); 885 "Net.HttpResponseCode_Nxx_MainFrame", response_code/100, 10);
870 } 886 }
871 887
872 net_log_.AddEvent( 888 net_log_.AddEvent(
873 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, 889 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS,
874 base::Bind(&HttpResponseHeaders::NetLogCallback, response_.headers)); 890 base::Bind(&HttpResponseHeaders::NetLogCallback, response_.headers));
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1448 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1433 state); 1449 state);
1434 break; 1450 break;
1435 } 1451 }
1436 return description; 1452 return description;
1437 } 1453 }
1438 1454
1439 #undef STATE_CASE 1455 #undef STATE_CASE
1440 1456
1441 } // namespace net 1457 } // namespace net
OLDNEW
« 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