OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 // If we want spdy over npn, make sure it succeeded. | 296 // If we want spdy over npn, make sure it succeeded. |
297 if (status == SSLClientSocket::kNextProtoNegotiated) { | 297 if (status == SSLClientSocket::kNextProtoNegotiated) { |
298 ssl_socket_->set_was_npn_negotiated(true); | 298 ssl_socket_->set_was_npn_negotiated(true); |
299 SSLClientSocket::NextProto next_protocol = | 299 SSLClientSocket::NextProto next_protocol = |
300 SSLClientSocket::NextProtoFromString(proto); | 300 SSLClientSocket::NextProtoFromString(proto); |
301 // If we negotiated either version of SPDY, we must have | 301 // If we negotiated either version of SPDY, we must have |
302 // advertised it, so allow it. | 302 // advertised it, so allow it. |
303 // TODO(mbelshe): verify it was a protocol we advertised? | 303 // TODO(mbelshe): verify it was a protocol we advertised? |
304 if (next_protocol == SSLClientSocket::kProtoSPDY1 || | 304 if (next_protocol == SSLClientSocket::kProtoSPDY1 || |
305 next_protocol == SSLClientSocket::kProtoSPDY2) { | 305 next_protocol == SSLClientSocket::kProtoSPDY2 || |
| 306 next_protocol == SSLClientSocket::kProtoSPDY21) { |
306 ssl_socket_->set_was_spdy_negotiated(true); | 307 ssl_socket_->set_was_spdy_negotiated(true); |
| 308 ssl_socket_->set_next_protocol_negotiated(next_protocol); |
307 } | 309 } |
308 } | 310 } |
309 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) | 311 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) |
310 return ERR_NPN_NEGOTIATION_FAILED; | 312 return ERR_NPN_NEGOTIATION_FAILED; |
311 | 313 |
312 // Spdy might be turned on by default, or it might be over npn. | 314 // Spdy might be turned on by default, or it might be over npn. |
313 bool using_spdy = params_->force_spdy_over_ssl() || | 315 bool using_spdy = params_->force_spdy_over_ssl() || |
314 params_->want_spdy_over_npn(); | 316 params_->want_spdy_over_npn(); |
315 | 317 |
316 if (result == OK || | 318 if (result == OK || |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 Flush(); | 618 Flush(); |
617 } | 619 } |
618 | 620 |
619 bool SSLClientSocketPool::CloseOneIdleConnection() { | 621 bool SSLClientSocketPool::CloseOneIdleConnection() { |
620 if (base_.CloseOneIdleSocket()) | 622 if (base_.CloseOneIdleSocket()) |
621 return true; | 623 return true; |
622 return base_.CloseOneIdleConnectionInLayeredPool(); | 624 return base_.CloseOneIdleConnectionInLayeredPool(); |
623 } | 625 } |
624 | 626 |
625 } // namespace net | 627 } // namespace net |
OLD | NEW |