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/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 SetNetworkTimeouts(QuicTime::Delta::Infinite(), | 263 SetNetworkTimeouts(QuicTime::Delta::Infinite(), |
264 config.IdleConnectionStateLifetime()); | 264 config.IdleConnectionStateLifetime()); |
265 } else { | 265 } else { |
266 SetNetworkTimeouts(config.max_time_before_crypto_handshake(), | 266 SetNetworkTimeouts(config.max_time_before_crypto_handshake(), |
267 config.max_idle_time_before_crypto_handshake()); | 267 config.max_idle_time_before_crypto_handshake()); |
268 } | 268 } |
269 } else { | 269 } else { |
270 SetIdleNetworkTimeout(config.IdleConnectionStateLifetime()); | 270 SetIdleNetworkTimeout(config.IdleConnectionStateLifetime()); |
271 } | 271 } |
272 sent_packet_manager_.SetFromConfig(config); | 272 sent_packet_manager_.SetFromConfig(config); |
| 273 if (FLAGS_allow_truncated_connection_ids_for_quic && |
| 274 config.HasReceivedBytesForConnectionId()) { |
| 275 packet_generator_.SetConnectionIdLength( |
| 276 config.ReceivedBytesForConnectionId()); |
| 277 } |
273 max_undecryptable_packets_ = config.max_undecryptable_packets(); | 278 max_undecryptable_packets_ = config.max_undecryptable_packets(); |
274 } | 279 } |
275 | 280 |
276 bool QuicConnection::SelectMutualVersion( | 281 bool QuicConnection::SelectMutualVersion( |
277 const QuicVersionVector& available_versions) { | 282 const QuicVersionVector& available_versions) { |
278 // Try to find the highest mutual version by iterating over supported | 283 // Try to find the highest mutual version by iterating over supported |
279 // versions, starting with the highest, and breaking out of the loop once we | 284 // versions, starting with the highest, and breaking out of the loop once we |
280 // find a matching version in the provided available_versions vector. | 285 // find a matching version in the provided available_versions vector. |
281 const QuicVersionVector& supported_versions = framer_.supported_versions(); | 286 const QuicVersionVector& supported_versions = framer_.supported_versions(); |
282 for (size_t i = 0; i < supported_versions.size(); ++i) { | 287 for (size_t i = 0; i < supported_versions.size(); ++i) { |
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 } | 2045 } |
2041 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2046 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
2042 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2047 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
2043 return true; | 2048 return true; |
2044 } | 2049 } |
2045 } | 2050 } |
2046 return false; | 2051 return false; |
2047 } | 2052 } |
2048 | 2053 |
2049 } // namespace net | 2054 } // namespace net |
OLD | NEW |