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/tools/quic/quic_server_session.h" | 5 #include "net/tools/quic/quic_server_session.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/crypto/cached_network_parameters.h" | 8 #include "net/quic/crypto/cached_network_parameters.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 if (!config()->HasReceivedConnectionOptions()) { | 42 if (!config()->HasReceivedConnectionOptions()) { |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 // If the client has provided a bandwidth estimate from the same serving | 46 // If the client has provided a bandwidth estimate from the same serving |
47 // region, then pass it to the sent packet manager in preparation for possible | 47 // region, then pass it to the sent packet manager in preparation for possible |
48 // bandwidth resumption. | 48 // bandwidth resumption. |
49 const CachedNetworkParameters* cached_network_params = | 49 const CachedNetworkParameters* cached_network_params = |
50 crypto_stream_->previous_cached_network_params(); | 50 crypto_stream_->previous_cached_network_params(); |
| 51 const bool max_bandwidth_resumption = |
| 52 ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWMX); |
51 if (cached_network_params != nullptr && | 53 if (cached_network_params != nullptr && |
52 ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWRE) && | 54 (ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWRE) || |
| 55 max_bandwidth_resumption) && |
53 cached_network_params->serving_region() == serving_region_) { | 56 cached_network_params->serving_region() == serving_region_) { |
54 connection()->ResumeConnectionState(*cached_network_params); | 57 connection()->ResumeConnectionState(*cached_network_params, |
| 58 max_bandwidth_resumption); |
55 } | 59 } |
56 | 60 |
57 if (FLAGS_enable_quic_fec && | 61 if (FLAGS_enable_quic_fec && |
58 ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { | 62 ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { |
59 // kFHDR config maps to FEC protection always for headers stream. | 63 // kFHDR config maps to FEC protection always for headers stream. |
60 // TODO(jri): Add crypto stream in addition to headers for kHDR. | 64 // TODO(jri): Add crypto stream in addition to headers for kHDR. |
61 headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); | 65 headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); |
62 } | 66 } |
63 } | 67 } |
64 | 68 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DLOG(ERROR) << "Server push not yet supported"; | 196 DLOG(ERROR) << "Server push not yet supported"; |
193 return nullptr; | 197 return nullptr; |
194 } | 198 } |
195 | 199 |
196 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { | 200 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { |
197 return crypto_stream_.get(); | 201 return crypto_stream_.get(); |
198 } | 202 } |
199 | 203 |
200 } // namespace tools | 204 } // namespace tools |
201 } // namespace net | 205 } // namespace net |
OLD | NEW |