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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 sent_packet_manager_.SetFromConfig(config); | 280 sent_packet_manager_.SetFromConfig(config); |
281 if (FLAGS_allow_truncated_connection_ids_for_quic && | 281 if (FLAGS_allow_truncated_connection_ids_for_quic && |
282 config.HasReceivedBytesForConnectionId() && | 282 config.HasReceivedBytesForConnectionId() && |
283 can_truncate_connection_ids_) { | 283 can_truncate_connection_ids_) { |
284 packet_generator_.SetConnectionIdLength( | 284 packet_generator_.SetConnectionIdLength( |
285 config.ReceivedBytesForConnectionId()); | 285 config.ReceivedBytesForConnectionId()); |
286 } | 286 } |
287 max_undecryptable_packets_ = config.max_undecryptable_packets(); | 287 max_undecryptable_packets_ = config.max_undecryptable_packets(); |
288 } | 288 } |
289 | 289 |
| 290 void QuicConnection::SetNumOpenStreams(size_t num_streams) { |
| 291 sent_packet_manager_.SetNumOpenStreams(num_streams); |
| 292 } |
| 293 |
290 bool QuicConnection::SelectMutualVersion( | 294 bool QuicConnection::SelectMutualVersion( |
291 const QuicVersionVector& available_versions) { | 295 const QuicVersionVector& available_versions) { |
292 // Try to find the highest mutual version by iterating over supported | 296 // Try to find the highest mutual version by iterating over supported |
293 // versions, starting with the highest, and breaking out of the loop once we | 297 // versions, starting with the highest, and breaking out of the loop once we |
294 // find a matching version in the provided available_versions vector. | 298 // find a matching version in the provided available_versions vector. |
295 const QuicVersionVector& supported_versions = framer_.supported_versions(); | 299 const QuicVersionVector& supported_versions = framer_.supported_versions(); |
296 for (size_t i = 0; i < supported_versions.size(); ++i) { | 300 for (size_t i = 0; i < supported_versions.size(); ++i) { |
297 const QuicVersion& version = supported_versions[i]; | 301 const QuicVersion& version = supported_versions[i]; |
298 if (std::find(available_versions.begin(), available_versions.end(), | 302 if (std::find(available_versions.begin(), available_versions.end(), |
299 version) != available_versions.end()) { | 303 version) != available_versions.end()) { |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 } | 2107 } |
2104 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2108 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
2105 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2109 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
2106 return true; | 2110 return true; |
2107 } | 2111 } |
2108 } | 2112 } |
2109 return false; | 2113 return false; |
2110 } | 2114 } |
2111 | 2115 |
2112 } // namespace net | 2116 } // namespace net |
OLD | NEW |