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

Side by Side Diff: net/quic/quic_crypto_server_stream.cc

Issue 1808793002: Use cached compressed certs if available to reduce load of compressing certs. Flag protected by qui… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
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_server_stream.h" 5 #include "net/quic/quic_crypto_server_stream.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "crypto/secure_hash.h" 8 #include "crypto/secure_hash.h"
9 #include "net/quic/crypto/crypto_protocol.h" 9 #include "net/quic/crypto/crypto_protocol.h"
10 #include "net/quic/crypto/crypto_utils.h" 10 #include "net/quic/crypto/crypto_utils.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (!handshake_confirmed_) { 219 if (!handshake_confirmed_) {
220 return; 220 return;
221 } 221 }
222 222
223 CryptoHandshakeMessage server_config_update_message; 223 CryptoHandshakeMessage server_config_update_message;
224 if (!crypto_config_->BuildServerConfigUpdateMessage( 224 if (!crypto_config_->BuildServerConfigUpdateMessage(
225 session()->connection()->version(), previous_source_address_tokens_, 225 session()->connection()->version(), previous_source_address_tokens_,
226 session()->connection()->self_address().address(), 226 session()->connection()->self_address().address(),
227 session()->connection()->peer_address().address(), 227 session()->connection()->peer_address().address(),
228 session()->connection()->clock(), 228 session()->connection()->clock(),
229 session()->connection()->random_generator(), 229 session()->connection()->random_generator(), compressed_certs_cache_,
230 crypto_negotiated_params_, cached_network_params, 230 crypto_negotiated_params_, cached_network_params,
231 &server_config_update_message)) { 231 &server_config_update_message)) {
232 DVLOG(1) << "Server: Failed to build server config update (SCUP)!"; 232 DVLOG(1) << "Server: Failed to build server config update (SCUP)!";
233 return; 233 return;
234 } 234 }
235 235
236 DVLOG(1) << "Server: Sending server config update: " 236 DVLOG(1) << "Server: Sending server config update: "
237 << server_config_update_message.DebugString(); 237 << server_config_update_message.DebugString();
238 const QuicData& data = server_config_update_message.GetSerialized(); 238 const QuicData& data = server_config_update_message.GetSerialized();
239 WriteOrBufferData(string(data.data(), data.length()), false, nullptr); 239 WriteOrBufferData(string(data.data(), data.length()), false, nullptr);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 QuicConnection* connection = session()->connection(); 332 QuicConnection* connection = session()->connection();
333 const QuicConnectionId server_designated_connection_id = 333 const QuicConnectionId server_designated_connection_id =
334 use_stateless_rejects_in_crypto_config 334 use_stateless_rejects_in_crypto_config
335 ? GenerateConnectionIdForReject(connection->connection_id()) 335 ? GenerateConnectionIdForReject(connection->connection_id())
336 : 0; 336 : 0;
337 return crypto_config_->ProcessClientHello( 337 return crypto_config_->ProcessClientHello(
338 result, connection->connection_id(), connection->self_address().address(), 338 result, connection->connection_id(), connection->self_address().address(),
339 connection->peer_address(), version(), connection->supported_versions(), 339 connection->peer_address(), version(), connection->supported_versions(),
340 use_stateless_rejects_in_crypto_config, server_designated_connection_id, 340 use_stateless_rejects_in_crypto_config, server_designated_connection_id,
341 connection->clock(), connection->random_generator(), 341 connection->clock(), connection->random_generator(),
342 &crypto_negotiated_params_, &crypto_proof_, reply, error_details); 342 compressed_certs_cache_, &crypto_negotiated_params_, &crypto_proof_,
343 reply, error_details);
343 } 344 }
344 345
345 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {} 346 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {}
346 347
347 QuicCryptoServerStream::ValidateCallback::ValidateCallback( 348 QuicCryptoServerStream::ValidateCallback::ValidateCallback(
348 QuicCryptoServerStream* parent) 349 QuicCryptoServerStream* parent)
349 : parent_(parent) {} 350 : parent_(parent) {}
350 351
351 void QuicCryptoServerStream::ValidateCallback::Cancel() { 352 void QuicCryptoServerStream::ValidateCallback::Cancel() {
352 parent_ = nullptr; 353 parent_ = nullptr;
(...skipping 26 matching lines...) Expand all
379 } 380 }
380 for (size_t i = 0; i < received_tags_length; ++i) { 381 for (size_t i = 0; i < received_tags_length; ++i) {
381 if (received_tags[i] == kSREJ) { 382 if (received_tags[i] == kSREJ) {
382 return true; 383 return true;
383 } 384 }
384 } 385 }
385 return false; 386 return false;
386 } 387 }
387 388
388 } // namespace net 389 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698