Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 330333006: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linus_tsan error - reverted the change to ConnectionMigrationClientPortChanged unitttest Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/crypto/quic_crypto_client_config.h" 5 #include "net/quic/crypto/quic_crypto_client_config.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "net/quic/crypto/cert_compressor.h" 9 #include "net/quic/crypto/cert_compressor.h"
10 #include "net/quic/crypto/chacha20_poly1305_encrypter.h" 10 #include "net/quic/crypto/chacha20_poly1305_encrypter.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 hashes.push_back(QuicUtils::FNV1a_64_Hash(i->data(), i->size())); 339 hashes.push_back(QuicUtils::FNV1a_64_Hash(i->data(), i->size()));
340 } 340 }
341 out->SetVector(kCCRT, hashes); 341 out->SetVector(kCCRT, hashes);
342 } 342 }
343 } 343 }
344 344
345 QuicErrorCode QuicCryptoClientConfig::FillClientHello( 345 QuicErrorCode QuicCryptoClientConfig::FillClientHello(
346 const QuicServerId& server_id, 346 const QuicServerId& server_id,
347 QuicConnectionId connection_id, 347 QuicConnectionId connection_id,
348 const QuicVersion preferred_version, 348 const QuicVersion preferred_version,
349 uint32 initial_flow_control_window_bytes,
350 const CachedState* cached, 349 const CachedState* cached,
351 QuicWallTime now, 350 QuicWallTime now,
352 QuicRandom* rand, 351 QuicRandom* rand,
353 const ChannelIDKey* channel_id_key, 352 const ChannelIDKey* channel_id_key,
354 QuicCryptoNegotiatedParameters* out_params, 353 QuicCryptoNegotiatedParameters* out_params,
355 CryptoHandshakeMessage* out, 354 CryptoHandshakeMessage* out,
356 string* error_details) const { 355 string* error_details) const {
357 DCHECK(error_details != NULL); 356 DCHECK(error_details != NULL);
358 357
359 FillInchoateClientHello(server_id, preferred_version, cached, 358 FillInchoateClientHello(server_id, preferred_version, cached,
360 out_params, out); 359 out_params, out);
361 360
362 // Set initial receive window for flow control.
363 out->SetValue(kIFCW, initial_flow_control_window_bytes);
364
365 const CryptoHandshakeMessage* scfg = cached->GetServerConfig(); 361 const CryptoHandshakeMessage* scfg = cached->GetServerConfig();
366 if (!scfg) { 362 if (!scfg) {
367 // This should never happen as our caller should have checked 363 // This should never happen as our caller should have checked
368 // cached->IsComplete() before calling this function. 364 // cached->IsComplete() before calling this function.
369 *error_details = "Handshake not ready"; 365 *error_details = "Handshake not ready";
370 return QUIC_CRYPTO_INTERNAL_ERROR; 366 return QUIC_CRYPTO_INTERNAL_ERROR;
371 } 367 }
372 368
373 StringPiece scid; 369 StringPiece scid;
374 if (!scfg->GetStringPiece(kSCID, &scid)) { 370 if (!scfg->GetStringPiece(kSCID, &scid)) {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 return; 744 return;
749 } 745 }
750 746
751 // Update canonical version to point at the "most recent" entry. 747 // Update canonical version to point at the "most recent" entry.
752 canonical_server_map_[suffix_server_id] = server_id; 748 canonical_server_map_[suffix_server_id] = server_id;
753 749
754 server_state->InitializeFrom(*canonical_state); 750 server_state->InitializeFrom(*canonical_state);
755 } 751 }
756 752
757 } // namespace net 753 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_crypto_client_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698