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

Unified Diff: net/quic/quic_crypto_server_stream.cc

Issue 648933003: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with TOT Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_crypto_server_stream.h ('k') | net/quic/quic_crypto_server_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_crypto_server_stream.cc
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc
index eebab9026604bc6b452059cf233389c11743411e..e912c32325b2298d0f73413b0231a9c178254987 100644
--- a/net/quic/quic_crypto_server_stream.cc
+++ b/net/quic/quic_crypto_server_stream.cc
@@ -11,6 +11,7 @@
#include "net/quic/crypto/quic_crypto_server_config.h"
#include "net/quic/crypto/source_address_token.h"
#include "net/quic/quic_config.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_session.h"
@@ -152,11 +153,12 @@ void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
// Now that the handshake is complete, send an updated server config and
// source-address token to the client.
- SendServerConfigUpdate(nullptr);
+ SendServerConfigUpdate(previous_cached_network_params_.get(), true);
}
void QuicCryptoServerStream::SendServerConfigUpdate(
- const CachedNetworkParameters* cached_network_params) {
+ const CachedNetworkParameters* cached_network_params,
+ bool on_handshake_complete) {
if (session()->connection()->version() <= QUIC_VERSION_21 ||
!handshake_confirmed_) {
return;
@@ -174,7 +176,8 @@ void QuicCryptoServerStream::SendServerConfigUpdate(
return;
}
- DVLOG(1) << "Server: Sending server config update: "
+ DVLOG(1) << "Server: Sending server config update"
+ << (on_handshake_complete ? " immediately after handshake: " : ": ")
<< server_config_update_message.DebugString();
const QuicData& data = server_config_update_message.GetSerialized();
WriteOrBufferData(string(data.data(), data.length()), false, nullptr);
@@ -221,6 +224,13 @@ QuicErrorCode QuicCryptoServerStream::ProcessClientHello(
const ValidateClientHelloResultCallback::Result& result,
CryptoHandshakeMessage* reply,
string* error_details) {
+ // Store the bandwidth estimate from the client.
+ if (FLAGS_quic_store_cached_network_params_from_chlo &&
+ result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) {
+ previous_cached_network_params_.reset(
+ new CachedNetworkParameters(result.cached_network_params));
+ }
+
return crypto_config_.ProcessClientHello(
result,
session()->connection()->connection_id(),
« no previous file with comments | « net/quic/quic_crypto_server_stream.h ('k') | net/quic/quic_crypto_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698