| 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 <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 AppendFixed(&out); | 314 AppendFixed(&out); |
| 315 | 315 |
| 316 // Send a local timestamp to the server. | 316 // Send a local timestamp to the server. |
| 317 out.SetValue(kCTIM, | 317 out.SetValue(kCTIM, |
| 318 session()->connection()->clock()->WallNow().ToUNIXSeconds()); | 318 session()->connection()->clock()->WallNow().ToUNIXSeconds()); |
| 319 | 319 |
| 320 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { | 320 if (!cached->IsComplete(session()->connection()->clock()->WallNow())) { |
| 321 crypto_config_->FillInchoateClientHello( | 321 crypto_config_->FillInchoateClientHello( |
| 322 server_id_, session()->connection()->supported_versions().front(), | 322 server_id_, session()->connection()->supported_versions().front(), |
| 323 cached, session()->connection()->random_generator(), | 323 cached, session()->connection()->random_generator(), |
| 324 &crypto_negotiated_params_, &out); | 324 /* demand_x509_proof= */ true, &crypto_negotiated_params_, &out); |
| 325 // Pad the inchoate client hello to fill up a packet. | 325 // Pad the inchoate client hello to fill up a packet. |
| 326 const QuicByteCount kFramingOverhead = 50; // A rough estimate. | 326 const QuicByteCount kFramingOverhead = 50; // A rough estimate. |
| 327 const QuicByteCount max_packet_size = | 327 const QuicByteCount max_packet_size = |
| 328 session()->connection()->max_packet_length(); | 328 session()->connection()->max_packet_length(); |
| 329 if (max_packet_size <= kFramingOverhead) { | 329 if (max_packet_size <= kFramingOverhead) { |
| 330 DLOG(DFATAL) << "max_packet_length (" << max_packet_size | 330 DLOG(DFATAL) << "max_packet_length (" << max_packet_size |
| 331 << ") has no room for framing overhead."; | 331 << ") has no room for framing overhead."; |
| 332 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, | 332 CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, |
| 333 "max_packet_size too smalll"); | 333 "max_packet_size too smalll"); |
| 334 return; | 334 return; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 } | 696 } |
| 697 for (size_t i = 0; i < num_their_proof_demands; i++) { | 697 for (size_t i = 0; i < num_their_proof_demands; i++) { |
| 698 if (their_proof_demands[i] == kCHID) { | 698 if (their_proof_demands[i] == kCHID) { |
| 699 return true; | 699 return true; |
| 700 } | 700 } |
| 701 } | 701 } |
| 702 return false; | 702 return false; |
| 703 } | 703 } |
| 704 | 704 |
| 705 } // namespace net | 705 } // namespace net |
| OLD | NEW |