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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 12252015: Make proxy fallback logic more captive-portal friendly, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix comment Created 7 years, 10 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 | no next file » | 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_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 // to proxy servers. The hostname in those URLs might fail to resolve if we 1168 // to proxy servers. The hostname in those URLs might fail to resolve if we
1169 // are still using a non-proxy config. We need to check if a proxy config 1169 // are still using a non-proxy config. We need to check if a proxy config
1170 // now exists that corresponds to a proxy server that could load the URL. 1170 // now exists that corresponds to a proxy server that could load the URL.
1171 // 1171 //
1172 switch (error) { 1172 switch (error) {
1173 case ERR_PROXY_CONNECTION_FAILED: 1173 case ERR_PROXY_CONNECTION_FAILED:
1174 case ERR_NAME_NOT_RESOLVED: 1174 case ERR_NAME_NOT_RESOLVED:
1175 case ERR_INTERNET_DISCONNECTED: 1175 case ERR_INTERNET_DISCONNECTED:
1176 case ERR_ADDRESS_UNREACHABLE: 1176 case ERR_ADDRESS_UNREACHABLE:
1177 case ERR_CONNECTION_CLOSED: 1177 case ERR_CONNECTION_CLOSED:
1178 case ERR_CONNECTION_TIMED_OUT:
1178 case ERR_CONNECTION_RESET: 1179 case ERR_CONNECTION_RESET:
1179 case ERR_CONNECTION_REFUSED: 1180 case ERR_CONNECTION_REFUSED:
1180 case ERR_CONNECTION_ABORTED: 1181 case ERR_CONNECTION_ABORTED:
1181 case ERR_TIMED_OUT: 1182 case ERR_TIMED_OUT:
1182 case ERR_TUNNEL_CONNECTION_FAILED: 1183 case ERR_TUNNEL_CONNECTION_FAILED:
1183 case ERR_SOCKS_CONNECTION_FAILED: 1184 case ERR_SOCKS_CONNECTION_FAILED:
1185 // This can happen in the case of trying to use an HTTPS proxy while behind
eroman 2013/02/14 00:03:47 Please word this differently. "HTTPS proxy" can me
mmenke 2013/02/14 00:28:11 Wait..."An HTTP proxy for https:// URLs"? Not an
mmenke 2013/02/14 00:52:39 I've updated it to be neutral ("Talking to a proxy
1186 // a captive portal that supports SSL.
1187 case ERR_PROXY_CERTIFICATE_INVALID:
1188 // This can happen when trying to talk SSL to a non-SSL server (Like a
1189 // captive portal).
1190 case ERR_SSL_PROTOCOL_ERROR:
1184 break; 1191 break;
1185 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: 1192 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE:
1186 // Remap the SOCKS-specific "host unreachable" error to a more 1193 // Remap the SOCKS-specific "host unreachable" error to a more
1187 // generic error code (this way consumers like the link doctor 1194 // generic error code (this way consumers like the link doctor
1188 // know to substitute their error page). 1195 // know to substitute their error page).
1189 // 1196 //
1190 // Note that if the host resolving was done by the SOCSK5 proxy, we can't 1197 // Note that if the host resolving was done by the SOCKS5 proxy, we can't
eroman 2013/02/14 00:03:47 hah!
1191 // differentiate between a proxy-side "host not found" versus a proxy-side 1198 // differentiate between a proxy-side "host not found" versus a proxy-side
1192 // "address unreachable" error, and will report both of these failures as 1199 // "address unreachable" error, and will report both of these failures as
1193 // ERR_ADDRESS_UNREACHABLE. 1200 // ERR_ADDRESS_UNREACHABLE.
1194 return ERR_ADDRESS_UNREACHABLE; 1201 return ERR_ADDRESS_UNREACHABLE;
1195 default: 1202 default:
1196 return error; 1203 return error;
1197 } 1204 }
1198 1205
1199 if (request_info_.load_flags & LOAD_BYPASS_PROXY) { 1206 if (request_info_.load_flags & LOAD_BYPASS_PROXY) {
1200 return error; 1207 return error;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | 1337 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH |
1331 net::LOAD_IS_DOWNLOAD)) { 1338 net::LOAD_IS_DOWNLOAD)) {
1332 // Avoid pipelining resources that may be streamed for a long time. 1339 // Avoid pipelining resources that may be streamed for a long time.
1333 return false; 1340 return false;
1334 } 1341 }
1335 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( 1342 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining(
1336 *http_pipelining_key_.get()); 1343 *http_pipelining_key_.get());
1337 } 1344 }
1338 1345
1339 } // namespace net 1346 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698