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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 config.IdleConnectionStateLifetime()); | 274 config.IdleConnectionStateLifetime()); |
275 if (FLAGS_quic_allow_silent_close && config.SilentClose()) { | 275 if (FLAGS_quic_allow_silent_close && config.SilentClose()) { |
276 silent_close_enabled_ = true; | 276 silent_close_enabled_ = true; |
277 } | 277 } |
278 } else { | 278 } else { |
279 SetNetworkTimeouts(config.max_time_before_crypto_handshake(), | 279 SetNetworkTimeouts(config.max_time_before_crypto_handshake(), |
280 config.max_idle_time_before_crypto_handshake()); | 280 config.max_idle_time_before_crypto_handshake()); |
281 } | 281 } |
282 | 282 |
283 sent_packet_manager_.SetFromConfig(config); | 283 sent_packet_manager_.SetFromConfig(config); |
284 if (FLAGS_allow_truncated_connection_ids_for_quic && | 284 if (config.HasReceivedBytesForConnectionId() && |
285 config.HasReceivedBytesForConnectionId() && | |
286 can_truncate_connection_ids_) { | 285 can_truncate_connection_ids_) { |
287 packet_generator_.SetConnectionIdLength( | 286 packet_generator_.SetConnectionIdLength( |
288 config.ReceivedBytesForConnectionId()); | 287 config.ReceivedBytesForConnectionId()); |
289 } | 288 } |
290 max_undecryptable_packets_ = config.max_undecryptable_packets(); | 289 max_undecryptable_packets_ = config.max_undecryptable_packets(); |
291 } | 290 } |
292 | 291 |
293 bool QuicConnection::ResumeConnectionState( | 292 bool QuicConnection::ResumeConnectionState( |
294 const CachedNetworkParameters& cached_network_params) { | 293 const CachedNetworkParameters& cached_network_params) { |
295 return sent_packet_manager_.ResumeConnectionState(cached_network_params); | 294 return sent_packet_manager_.ResumeConnectionState(cached_network_params); |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2108 } | 2107 } |
2109 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2108 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
2110 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2109 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
2111 return true; | 2110 return true; |
2112 } | 2111 } |
2113 } | 2112 } |
2114 return false; | 2113 return false; |
2115 } | 2114 } |
2116 | 2115 |
2117 } // namespace net | 2116 } // namespace net |
OLD | NEW |