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_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
6 | 6 |
7 #include "net/quic/crypto/crypto_protocol.h" | 7 #include "net/quic/crypto/crypto_protocol.h" |
8 #include "net/quic/crypto/crypto_utils.h" | 8 #include "net/quic/crypto/crypto_utils.h" |
9 #include "net/quic/crypto/null_encrypter.h" | 9 #include "net/quic/crypto/null_encrypter.h" |
10 #include "net/quic/quic_client_session_base.h" | 10 #include "net/quic/quic_client_session_base.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool QuicCryptoClientStream::CryptoConnect() { | 102 bool QuicCryptoClientStream::CryptoConnect() { |
103 next_state_ = STATE_INITIALIZE; | 103 next_state_ = STATE_INITIALIZE; |
104 DoHandshakeLoop(NULL); | 104 DoHandshakeLoop(NULL); |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 int QuicCryptoClientStream::num_sent_client_hellos() const { | 108 int QuicCryptoClientStream::num_sent_client_hellos() const { |
109 return num_client_hellos_; | 109 return num_client_hellos_; |
110 } | 110 } |
111 | 111 |
| 112 bool QuicCryptoClientStream::WasChannelIDSent() const { |
| 113 // TODO(rch): we should replace this with a boolean member so we |
| 114 // can free the memory associated with the key after we're finished with it. |
| 115 return channel_id_key_.get() != NULL; |
| 116 } |
| 117 |
112 // kMaxClientHellos is the maximum number of times that we'll send a client | 118 // kMaxClientHellos is the maximum number of times that we'll send a client |
113 // hello. The value 3 accounts for: | 119 // hello. The value 3 accounts for: |
114 // * One failure due to an incorrect or missing source-address token. | 120 // * One failure due to an incorrect or missing source-address token. |
115 // * One failure due the server's certificate chain being unavailible and the | 121 // * One failure due the server's certificate chain being unavailible and the |
116 // server being unwilling to send it without a valid source-address token. | 122 // server being unwilling to send it without a valid source-address token. |
117 static const int kMaxClientHellos = 3; | 123 static const int kMaxClientHellos = 3; |
118 | 124 |
119 void QuicCryptoClientStream::DoHandshakeLoop( | 125 void QuicCryptoClientStream::DoHandshakeLoop( |
120 const CryptoHandshakeMessage* in) { | 126 const CryptoHandshakeMessage* in) { |
121 CryptoHandshakeMessage out; | 127 CryptoHandshakeMessage out; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 } | 456 } |
451 } | 457 } |
452 return false; | 458 return false; |
453 } | 459 } |
454 | 460 |
455 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 461 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
456 return reinterpret_cast<QuicClientSessionBase*>(session()); | 462 return reinterpret_cast<QuicClientSessionBase*>(session()); |
457 } | 463 } |
458 | 464 |
459 } // namespace net | 465 } // namespace net |
OLD | NEW |