| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 using_spdy_ = true; | 897 using_spdy_ = true; |
| 898 next_state_ = STATE_CREATE_STREAM; | 898 next_state_ = STATE_CREATE_STREAM; |
| 899 } else { | 899 } else { |
| 900 // It is possible that the spdy session no longer exists. | 900 // It is possible that the spdy session no longer exists. |
| 901 ReturnToStateInitConnection(true /* close connection */); | 901 ReturnToStateInitConnection(true /* close connection */); |
| 902 } | 902 } |
| 903 return OK; | 903 return OK; |
| 904 } | 904 } |
| 905 | 905 |
| 906 if (proxy_info_.is_quic() && using_quic_ && | 906 if (proxy_info_.is_quic() && using_quic_ && |
| 907 result == ERR_QUIC_PROTOCOL_ERROR) { | 907 (result == ERR_QUIC_PROTOCOL_ERROR || |
| 908 result == ERR_QUIC_HANDSHAKE_FAILED)) { |
| 908 using_quic_ = false; | 909 using_quic_ = false; |
| 909 return ReconsiderProxyAfterError(result); | 910 return ReconsiderProxyAfterError(result); |
| 910 } | 911 } |
| 911 | 912 |
| 912 // TODO(willchan): Make this a bit more exact. Maybe there are recoverable | 913 // TODO(willchan): Make this a bit more exact. Maybe there are recoverable |
| 913 // errors, such as ignoring certificate errors for Alternate-Protocol. | 914 // errors, such as ignoring certificate errors for Alternate-Protocol. |
| 914 if (result < 0 && waiting_job_) { | 915 if (result < 0 && waiting_job_) { |
| 915 waiting_job_->Resume(this); | 916 waiting_job_->Resume(this); |
| 916 waiting_job_ = NULL; | 917 waiting_job_ = NULL; |
| 917 } | 918 } |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 case ERR_CONNECTION_ABORTED: | 1314 case ERR_CONNECTION_ABORTED: |
| 1314 case ERR_TIMED_OUT: | 1315 case ERR_TIMED_OUT: |
| 1315 case ERR_TUNNEL_CONNECTION_FAILED: | 1316 case ERR_TUNNEL_CONNECTION_FAILED: |
| 1316 case ERR_SOCKS_CONNECTION_FAILED: | 1317 case ERR_SOCKS_CONNECTION_FAILED: |
| 1317 // This can happen in the case of trying to talk to a proxy using SSL, and | 1318 // This can happen in the case of trying to talk to a proxy using SSL, and |
| 1318 // ending up talking to a captive portal that supports SSL instead. | 1319 // ending up talking to a captive portal that supports SSL instead. |
| 1319 case ERR_PROXY_CERTIFICATE_INVALID: | 1320 case ERR_PROXY_CERTIFICATE_INVALID: |
| 1320 // This can happen when trying to talk SSL to a non-SSL server (Like a | 1321 // This can happen when trying to talk SSL to a non-SSL server (Like a |
| 1321 // captive portal). | 1322 // captive portal). |
| 1322 case ERR_QUIC_PROTOCOL_ERROR: | 1323 case ERR_QUIC_PROTOCOL_ERROR: |
| 1324 case ERR_QUIC_HANDSHAKE_FAILED: |
| 1323 case ERR_SSL_PROTOCOL_ERROR: | 1325 case ERR_SSL_PROTOCOL_ERROR: |
| 1324 break; | 1326 break; |
| 1325 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: | 1327 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: |
| 1326 // Remap the SOCKS-specific "host unreachable" error to a more | 1328 // Remap the SOCKS-specific "host unreachable" error to a more |
| 1327 // generic error code (this way consumers like the link doctor | 1329 // generic error code (this way consumers like the link doctor |
| 1328 // know to substitute their error page). | 1330 // know to substitute their error page). |
| 1329 // | 1331 // |
| 1330 // Note that if the host resolving was done by the SOCKS5 proxy, we can't | 1332 // Note that if the host resolving was done by the SOCKS5 proxy, we can't |
| 1331 // differentiate between a proxy-side "host not found" versus a proxy-side | 1333 // differentiate between a proxy-side "host not found" versus a proxy-side |
| 1332 // "address unreachable" error, and will report both of these failures as | 1334 // "address unreachable" error, and will report both of these failures as |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1488 | 1490 |
| 1489 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1491 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
| 1490 HistogramBrokenAlternateProtocolLocation( | 1492 HistogramBrokenAlternateProtocolLocation( |
| 1491 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1493 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
| 1492 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1494 session_->http_server_properties()->SetBrokenAlternateProtocol( |
| 1493 HostPortPair::FromURL(request_info_.url)); | 1495 HostPortPair::FromURL(request_info_.url)); |
| 1494 } | 1496 } |
| 1495 } | 1497 } |
| 1496 | 1498 |
| 1497 } // namespace net | 1499 } // namespace net |
| OLD | NEW |