OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_request.h" | 5 #include "net/http/http_stream_request.h" |
6 | 6 |
7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 // proxy, then we might have a SPDY session to the proxy | 752 // proxy, then we might have a SPDY session to the proxy |
753 pair = HostPortProxyPair(proxy_server.host_port_pair(), | 753 pair = HostPortProxyPair(proxy_server.host_port_pair(), |
754 ProxyServer::Direct()); | 754 ProxyServer::Direct()); |
755 if (spdy_pool->HasSession(pair)) { | 755 if (spdy_pool->HasSession(pair)) { |
756 spdy_session = | 756 spdy_session = |
757 spdy_pool->Get(pair, session_->mutable_spdy_settings(), net_log_); | 757 spdy_pool->Get(pair, session_->mutable_spdy_settings(), net_log_); |
758 } | 758 } |
759 direct = false; | 759 direct = false; |
760 } | 760 } |
761 | 761 |
762 if (!spdy_session.get()) { | 762 if (spdy_session.get()) { |
| 763 // We picked up an existing session, so we don't need our socket. |
| 764 if (connection_->socket()) |
| 765 connection_->socket()->Disconnect(); |
| 766 connection_->Reset(); |
| 767 } else { |
763 // SPDY can be negotiated using the TLS next protocol negotiation (NPN) | 768 // SPDY can be negotiated using the TLS next protocol negotiation (NPN) |
764 // extension, or just directly using SSL. Either way, |connection_| must | 769 // extension, or just directly using SSL. Either way, |connection_| must |
765 // contain an SSLClientSocket. | 770 // contain an SSLClientSocket. |
766 CHECK(connection_->socket()); | 771 CHECK(connection_->socket()); |
767 int error = spdy_pool->GetSpdySessionFromSocket( | 772 int error = spdy_pool->GetSpdySessionFromSocket( |
768 pair, session_->mutable_spdy_settings(), connection_.release(), | 773 pair, session_->mutable_spdy_settings(), connection_.release(), |
769 net_log_, spdy_certificate_error_, &spdy_session, using_ssl_); | 774 net_log_, spdy_certificate_error_, &spdy_session, using_ssl_); |
770 if (error != OK) | 775 if (error != OK) |
771 return error; | 776 return error; |
772 } | 777 } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 base::TimeDelta::FromMinutes(6), | 1044 base::TimeDelta::FromMinutes(6), |
1040 100); | 1045 100); |
1041 break; | 1046 break; |
1042 default: | 1047 default: |
1043 NOTREACHED(); | 1048 NOTREACHED(); |
1044 break; | 1049 break; |
1045 } | 1050 } |
1046 } | 1051 } |
1047 | 1052 |
1048 } // namespace net | 1053 } // namespace net |
OLD | NEW |