Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: net/quic/quic_connection.cc

Issue 1572033003: relnote: Allowing multipath support negotiation. Protected by --quic_enable_multipath, default valu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0044_CL_111708360
Patch Set: rebase after removing 111628983 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 peer_port_changed_(false), 309 peer_port_changed_(false),
310 self_ip_changed_(false), 310 self_ip_changed_(false),
311 self_port_changed_(false), 311 self_port_changed_(false),
312 can_truncate_connection_ids_(true), 312 can_truncate_connection_ids_(true),
313 mtu_discovery_target_(0), 313 mtu_discovery_target_(0),
314 mtu_probe_count_(0), 314 mtu_probe_count_(0),
315 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase), 315 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase),
316 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase), 316 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase),
317 largest_received_packet_size_(0), 317 largest_received_packet_size_(0),
318 goaway_sent_(false), 318 goaway_sent_(false),
319 goaway_received_(false) { 319 goaway_received_(false),
320 multipath_enabled_(false) {
320 DVLOG(1) << ENDPOINT 321 DVLOG(1) << ENDPOINT
321 << "Created connection with connection_id: " << connection_id; 322 << "Created connection with connection_id: " << connection_id;
322 framer_.set_visitor(this); 323 framer_.set_visitor(this);
323 framer_.set_received_entropy_calculator(&received_packet_manager_); 324 framer_.set_received_entropy_calculator(&received_packet_manager_);
324 last_stop_waiting_frame_.least_unacked = 0; 325 last_stop_waiting_frame_.least_unacked = 0;
325 stats_.connection_creation_time = clock_->ApproximateNow(); 326 stats_.connection_creation_time = clock_->ApproximateNow();
326 sent_packet_manager_.set_network_change_visitor(this); 327 sent_packet_manager_.set_network_change_visitor(this);
327 // Allow the packet writer to potentially reduce the packet size to a value 328 // Allow the packet writer to potentially reduce the packet size to a value
328 // even smaller than kDefaultMaxPacketSize. 329 // even smaller than kDefaultMaxPacketSize.
329 SetMaxPacketLength(perspective_ == Perspective::IS_SERVER 330 SetMaxPacketLength(perspective_ == Perspective::IS_SERVER
(...skipping 22 matching lines...) Expand all
352 queued_packets_.clear(); 353 queued_packets_.clear();
353 } 354 }
354 355
355 void QuicConnection::SetFromConfig(const QuicConfig& config) { 356 void QuicConnection::SetFromConfig(const QuicConfig& config) {
356 if (config.negotiated()) { 357 if (config.negotiated()) {
357 SetNetworkTimeouts(QuicTime::Delta::Infinite(), 358 SetNetworkTimeouts(QuicTime::Delta::Infinite(),
358 config.IdleConnectionStateLifetime()); 359 config.IdleConnectionStateLifetime());
359 if (config.SilentClose()) { 360 if (config.SilentClose()) {
360 silent_close_enabled_ = true; 361 silent_close_enabled_ = true;
361 } 362 }
363 if (FLAGS_quic_enable_multipath &&
364 config.MultipathEnabled()) {
365 multipath_enabled_ = true;
366 }
362 } else { 367 } else {
363 SetNetworkTimeouts(config.max_time_before_crypto_handshake(), 368 SetNetworkTimeouts(config.max_time_before_crypto_handshake(),
364 config.max_idle_time_before_crypto_handshake()); 369 config.max_idle_time_before_crypto_handshake());
365 } 370 }
366 371
367 sent_packet_manager_.SetFromConfig(config); 372 sent_packet_manager_.SetFromConfig(config);
368 if (config.HasReceivedBytesForConnectionId() && 373 if (config.HasReceivedBytesForConnectionId() &&
369 can_truncate_connection_ids_) { 374 can_truncate_connection_ids_) {
370 packet_generator_.SetConnectionIdLength( 375 packet_generator_.SetConnectionIdLength(
371 config.ReceivedBytesForConnectionId()); 376 config.ReceivedBytesForConnectionId());
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 SendMtuDiscoveryPacket(mtu_discovery_target_); 2405 SendMtuDiscoveryPacket(mtu_discovery_target_);
2401 2406
2402 DCHECK(!mtu_discovery_alarm_->IsSet()); 2407 DCHECK(!mtu_discovery_alarm_->IsSet());
2403 } 2408 }
2404 2409
2405 bool QuicConnection::ack_frame_updated() const { 2410 bool QuicConnection::ack_frame_updated() const {
2406 return received_packet_manager_.ack_frame_updated(); 2411 return received_packet_manager_.ack_frame_updated();
2407 } 2412 }
2408 2413
2409 } // namespace net 2414 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698