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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 413 |
414 int QuicClientSession::GetNumSentClientHellos() const { | 414 int QuicClientSession::GetNumSentClientHellos() const { |
415 return crypto_stream_->num_sent_client_hellos(); | 415 return crypto_stream_->num_sent_client_hellos(); |
416 } | 416 } |
417 | 417 |
418 bool QuicClientSession::CanPool(const std::string& hostname) const { | 418 bool QuicClientSession::CanPool(const std::string& hostname) const { |
419 // TODO(rch): When QUIC supports channel ID or client certificates, this | 419 // TODO(rch): When QUIC supports channel ID or client certificates, this |
420 // logic will need to be revised. | 420 // logic will need to be revised. |
421 DCHECK(connection()->connected()); | 421 DCHECK(connection()->connected()); |
422 SSLInfo ssl_info; | 422 SSLInfo ssl_info; |
423 bool unused = false; | |
424 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert) { | 423 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert) { |
425 // We can always pool with insecure QUIC sessions. | 424 // We can always pool with insecure QUIC sessions. |
426 return true; | 425 return true; |
427 } | 426 } |
| 427 |
| 428 // Disable pooling for secure sessions. |
| 429 // TODO(rch): re-enable this. |
| 430 return false; |
| 431 |
| 432 #if 0 |
| 433 bool unused = false; |
428 // Only pool secure QUIC sessions if the cert matches the new hostname. | 434 // Only pool secure QUIC sessions if the cert matches the new hostname. |
429 return ssl_info.cert->VerifyNameMatch(hostname, &unused); | 435 return ssl_info.cert->VerifyNameMatch(hostname, &unused); |
| 436 #endif |
430 } | 437 } |
431 | 438 |
432 QuicDataStream* QuicClientSession::CreateIncomingDataStream( | 439 QuicDataStream* QuicClientSession::CreateIncomingDataStream( |
433 QuicStreamId id) { | 440 QuicStreamId id) { |
434 DLOG(ERROR) << "Server push not supported"; | 441 DLOG(ERROR) << "Server push not supported"; |
435 return NULL; | 442 return NULL; |
436 } | 443 } |
437 | 444 |
438 void QuicClientSession::CloseStream(QuicStreamId stream_id) { | 445 void QuicClientSession::CloseStream(QuicStreamId stream_id) { |
439 ReliableQuicStream* stream = GetStream(stream_id); | 446 ReliableQuicStream* stream = GetStream(stream_id); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 RecordUnexpectedNotGoingAway(NOTIFY_FACTORY_OF_SESSION_CLOSED); | 735 RecordUnexpectedNotGoingAway(NOTIFY_FACTORY_OF_SESSION_CLOSED); |
729 | 736 |
730 going_away_ = true; | 737 going_away_ = true; |
731 DCHECK_EQ(0u, GetNumOpenStreams()); | 738 DCHECK_EQ(0u, GetNumOpenStreams()); |
732 // Will delete |this|. | 739 // Will delete |this|. |
733 if (stream_factory_) | 740 if (stream_factory_) |
734 stream_factory_->OnSessionClosed(this); | 741 stream_factory_->OnSessionClosed(this); |
735 } | 742 } |
736 | 743 |
737 } // namespace net | 744 } // namespace net |
OLD | NEW |