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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 291 } |
292 num_client_hellos_++; | 292 num_client_hellos_++; |
293 | 293 |
294 CryptoHandshakeMessage out; | 294 CryptoHandshakeMessage out; |
295 DCHECK(session() != nullptr); | 295 DCHECK(session() != nullptr); |
296 DCHECK(session()->config() != nullptr); | 296 DCHECK(session()->config() != nullptr); |
297 // Send all the options, regardless of whether we're sending an | 297 // Send all the options, regardless of whether we're sending an |
298 // inchoate or subsequent hello. | 298 // inchoate or subsequent hello. |
299 session()->config()->ToHandshakeMessage(&out); | 299 session()->config()->ToHandshakeMessage(&out); |
300 | 300 |
301 // This block and function should be removed after removing QUIC_VERSION_25. | 301 // This call and function should be removed after removing QUIC_VERSION_25. |
302 if (FLAGS_quic_require_fix) { | 302 AppendFixed(&out); |
303 AppendFixed(&out); | |
304 } | |
305 | 303 |
306 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { | 304 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { |
307 crypto_config_->FillInchoateClientHello( | 305 crypto_config_->FillInchoateClientHello( |
308 server_id_, session()->connection()->supported_versions().front(), | 306 server_id_, session()->connection()->supported_versions().front(), |
309 cached, &crypto_negotiated_params_, &out); | 307 cached, &crypto_negotiated_params_, &out); |
310 // Pad the inchoate client hello to fill up a packet. | 308 // Pad the inchoate client hello to fill up a packet. |
311 const QuicByteCount kFramingOverhead = 50; // A rough estimate. | 309 const QuicByteCount kFramingOverhead = 50; // A rough estimate. |
312 const QuicByteCount max_packet_size = | 310 const QuicByteCount max_packet_size = |
313 session()->connection()->max_packet_length(); | 311 session()->connection()->max_packet_length(); |
314 if (max_packet_size <= kFramingOverhead) { | 312 if (max_packet_size <= kFramingOverhead) { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } | 668 } |
671 } | 669 } |
672 return false; | 670 return false; |
673 } | 671 } |
674 | 672 |
675 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 673 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
676 return reinterpret_cast<QuicClientSessionBase*>(session()); | 674 return reinterpret_cast<QuicClientSessionBase*>(session()); |
677 } | 675 } |
678 | 676 |
679 } // namespace net | 677 } // namespace net |
OLD | NEW |