| 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/crypto/proof_verifier.h" | 10 #include "net/quic/crypto/proof_verifier.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 num_client_hellos_++; | 125 num_client_hellos_++; |
| 126 | 126 |
| 127 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { | 127 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { |
| 128 crypto_config_->FillInchoateClientHello( | 128 crypto_config_->FillInchoateClientHello( |
| 129 server_id_, | 129 server_id_, |
| 130 session()->connection()->supported_versions().front(), | 130 session()->connection()->supported_versions().front(), |
| 131 cached, &crypto_negotiated_params_, &out); | 131 cached, &crypto_negotiated_params_, &out); |
| 132 // Pad the inchoate client hello to fill up a packet. | 132 // Pad the inchoate client hello to fill up a packet. |
| 133 const size_t kFramingOverhead = 50; // A rough estimate. | 133 const size_t kFramingOverhead = 50; // A rough estimate. |
| 134 const size_t max_packet_size = | 134 const size_t max_packet_size = |
| 135 session()->connection()->options()->max_packet_length; | 135 session()->connection()->max_packet_length(); |
| 136 if (max_packet_size <= kFramingOverhead) { | 136 if (max_packet_size <= kFramingOverhead) { |
| 137 DLOG(DFATAL) << "max_packet_length (" << max_packet_size | 137 DLOG(DFATAL) << "max_packet_length (" << max_packet_size |
| 138 << ") has no room for framing overhead."; | 138 << ") has no room for framing overhead."; |
| 139 CloseConnection(QUIC_INTERNAL_ERROR); | 139 CloseConnection(QUIC_INTERNAL_ERROR); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 if (kClientHelloMinimumSize > max_packet_size - kFramingOverhead) { | 142 if (kClientHelloMinimumSize > max_packet_size - kFramingOverhead) { |
| 143 DLOG(DFATAL) << "Client hello won't fit in a single packet."; | 143 DLOG(DFATAL) << "Client hello won't fit in a single packet."; |
| 144 CloseConnection(QUIC_INTERNAL_ERROR); | 144 CloseConnection(QUIC_INTERNAL_ERROR); |
| 145 return; | 145 return; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 QuicCryptoClientConfig::CachedState* cached) { | 358 QuicCryptoClientConfig::CachedState* cached) { |
| 359 cached->SetProofValid(); | 359 cached->SetProofValid(); |
| 360 client_session()->OnProofValid(*cached); | 360 client_session()->OnProofValid(*cached); |
| 361 } | 361 } |
| 362 | 362 |
| 363 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 363 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
| 364 return reinterpret_cast<QuicClientSessionBase*>(session()); | 364 return reinterpret_cast<QuicClientSessionBase*>(session()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace net | 367 } // namespace net |
| OLD | NEW |