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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 replacements.SetHostStr(destination.host()); | 856 replacements.SetHostStr(destination.host()); |
857 const std::string new_port = base::UintToString(destination.port()); | 857 const std::string new_port = base::UintToString(destination.port()); |
858 replacements.SetPortStr(new_port); | 858 replacements.SetPortStr(new_port); |
859 replacements.ClearUsername(); | 859 replacements.ClearUsername(); |
860 replacements.ClearPassword(); | 860 replacements.ClearPassword(); |
861 replacements.ClearPath(); | 861 replacements.ClearPath(); |
862 replacements.ClearQuery(); | 862 replacements.ClearQuery(); |
863 replacements.ClearRef(); | 863 replacements.ClearRef(); |
864 url = url.ReplaceComponents(replacements); | 864 url = url.ReplaceComponents(replacements); |
865 | 865 |
866 // If QUIC is disabled on the destination port, return error. | 866 if (session_->quic_stream_factory()->IsQuicDisabled()) |
867 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port())) | |
868 return ERR_QUIC_PROTOCOL_ERROR; | 867 return ERR_QUIC_PROTOCOL_ERROR; |
869 } else { | 868 } else { |
870 DCHECK(using_ssl_); | 869 DCHECK(using_ssl_); |
871 // The certificate of a QUIC alternative server is expected to be valid | 870 // The certificate of a QUIC alternative server is expected to be valid |
872 // for the origin of the request (in addition to being valid for the | 871 // for the origin of the request (in addition to being valid for the |
873 // server itself). | 872 // server itself). |
874 destination = destination_; | 873 destination = destination_; |
875 ssl_config = &server_ssl_config_; | 874 ssl_config = &server_ssl_config_; |
876 } | 875 } |
877 int rv = | 876 int rv = |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 using_spdy_ = true; | 985 using_spdy_ = true; |
987 next_state_ = STATE_CREATE_STREAM; | 986 next_state_ = STATE_CREATE_STREAM; |
988 } else { | 987 } else { |
989 // It is possible that the spdy session no longer exists. | 988 // It is possible that the spdy session no longer exists. |
990 ReturnToStateInitConnection(true /* close connection */); | 989 ReturnToStateInitConnection(true /* close connection */); |
991 } | 990 } |
992 return OK; | 991 return OK; |
993 } | 992 } |
994 | 993 |
995 if (proxy_info_.is_quic() && using_quic_) { | 994 if (proxy_info_.is_quic() && using_quic_) { |
996 // Mark QUIC proxy as bad if QUIC got disabled on the destination port. | 995 // Mark QUIC proxy as bad if QUIC got disabled. |
997 // Underlying QUIC layer would have closed the connection. | 996 // Underlying QUIC layer would have closed the connection. |
998 HostPortPair destination = proxy_info_.proxy_server().host_port_pair(); | 997 HostPortPair destination = proxy_info_.proxy_server().host_port_pair(); |
999 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port())) { | 998 if (session_->quic_stream_factory()->IsQuicDisabled()) { |
1000 using_quic_ = false; | 999 using_quic_ = false; |
1001 return ReconsiderProxyAfterError(ERR_QUIC_PROTOCOL_ERROR); | 1000 return ReconsiderProxyAfterError(ERR_QUIC_PROTOCOL_ERROR); |
1002 } | 1001 } |
1003 } | 1002 } |
1004 | 1003 |
1005 // |result| may be the result of any of the stacked pools. The following | 1004 // |result| may be the result of any of the stacked pools. The following |
1006 // logic is used when determining how to interpret an error. | 1005 // logic is used when determining how to interpret an error. |
1007 // If |result| < 0: | 1006 // If |result| < 0: |
1008 // and connection_->socket() != NULL, then the SSL handshake ran and it | 1007 // and connection_->socket() != NULL, then the SSL handshake ran and it |
1009 // is a potentially recoverable error. | 1008 // is a potentially recoverable error. |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 | 1625 |
1627 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1626 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
1628 if (connection_->socket()) { | 1627 if (connection_->socket()) { |
1629 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1628 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
1630 } | 1629 } |
1631 | 1630 |
1632 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1631 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
1633 } | 1632 } |
1634 | 1633 |
1635 } // namespace net | 1634 } // namespace net |
OLD | NEW |