Index: net/tools/quic/quic_server_session.cc |
diff --git a/net/tools/quic/quic_server_session.cc b/net/tools/quic/quic_server_session.cc |
index 45c1379c4ae20650f2321152c50a962e2cf83b1f..9db23659601c3202bcb76c75dc9c5c6ea90f44df 100644 |
--- a/net/tools/quic/quic_server_session.cc |
+++ b/net/tools/quic/quic_server_session.cc |
@@ -38,14 +38,29 @@ QuicCryptoServerStream* QuicServerSession::CreateQuicCryptoServerStream( |
void QuicServerSession::OnConfigNegotiated() { |
QuicSession::OnConfigNegotiated(); |
- if (!FLAGS_enable_quic_fec || |
- !config()->HasReceivedConnectionOptions() || |
- !net::ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { |
+ |
+ if (!config()->HasReceivedConnectionOptions()) { |
return; |
} |
- // kFHDR config maps to FEC protection always for headers stream. |
- // TODO(jri): Add crypto stream in addition to headers for kHDR. |
- headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); |
+ |
+ // If the client has provided a bandwidth estimate from the same serving |
+ // region, then pass it to the sent packet manager in preparation for possible |
+ // bandwidth resumption. |
+ const CachedNetworkParameters* cached_network_params = |
+ crypto_stream_->previous_cached_network_params(); |
+ if (FLAGS_quic_enable_bandwidth_resumption_experiment && |
+ cached_network_params != nullptr && |
+ ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWRE) && |
+ cached_network_params->serving_region() == serving_region_) { |
+ connection()->ResumeConnectionState(*cached_network_params); |
+ } |
+ |
+ if (FLAGS_enable_quic_fec && |
+ ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { |
+ // kFHDR config maps to FEC protection always for headers stream. |
+ // TODO(jri): Add crypto stream in addition to headers for kHDR. |
+ headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); |
+ } |
} |
void QuicServerSession::OnConnectionClosed(QuicErrorCode error, |