OLD | NEW |
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 Loading... |
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 talk to a proxy using SSL, and |
| 1186 // ending up talking to a captive portal that supports SSL instead. |
| 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 |
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 Loading... |
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 |
OLD | NEW |