| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 #define ENDPOINT \ | 256 #define ENDPOINT \ |
| 257 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ") | 257 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ") |
| 258 | 258 |
| 259 QuicConnection::QuicConnection(QuicConnectionId connection_id, | 259 QuicConnection::QuicConnection(QuicConnectionId connection_id, |
| 260 IPEndPoint address, | 260 IPEndPoint address, |
| 261 QuicConnectionHelperInterface* helper, | 261 QuicConnectionHelperInterface* helper, |
| 262 const PacketWriterFactory& writer_factory, | 262 const PacketWriterFactory& writer_factory, |
| 263 bool owns_writer, | 263 bool owns_writer, |
| 264 Perspective perspective, | 264 Perspective perspective, |
| 265 bool is_secure, | |
| 266 const QuicVersionVector& supported_versions) | 265 const QuicVersionVector& supported_versions) |
| 267 : framer_(supported_versions, | 266 : framer_(supported_versions, |
| 268 helper->GetClock()->ApproximateNow(), | 267 helper->GetClock()->ApproximateNow(), |
| 269 perspective), | 268 perspective), |
| 270 helper_(helper), | 269 helper_(helper), |
| 271 writer_(writer_factory.Create(this)), | 270 writer_(writer_factory.Create(this)), |
| 272 owns_writer_(owns_writer), | 271 owns_writer_(owns_writer), |
| 273 encryption_level_(ENCRYPTION_NONE), | 272 encryption_level_(ENCRYPTION_NONE), |
| 274 has_forward_secure_encrypter_(false), | 273 has_forward_secure_encrypter_(false), |
| 275 first_required_forward_secure_packet_(0), | 274 first_required_forward_secure_packet_(0), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 idle_network_timeout_(QuicTime::Delta::Infinite()), | 307 idle_network_timeout_(QuicTime::Delta::Infinite()), |
| 309 overall_connection_timeout_(QuicTime::Delta::Infinite()), | 308 overall_connection_timeout_(QuicTime::Delta::Infinite()), |
| 310 time_of_last_received_packet_(clock_->ApproximateNow()), | 309 time_of_last_received_packet_(clock_->ApproximateNow()), |
| 311 time_of_last_sent_new_packet_(clock_->ApproximateNow()), | 310 time_of_last_sent_new_packet_(clock_->ApproximateNow()), |
| 312 packet_number_of_last_sent_packet_(0), | 311 packet_number_of_last_sent_packet_(0), |
| 313 sent_packet_manager_( | 312 sent_packet_manager_( |
| 314 perspective, | 313 perspective, |
| 315 clock_, | 314 clock_, |
| 316 &stats_, | 315 &stats_, |
| 317 FLAGS_quic_use_bbr_congestion_control ? kBBR : kCubic, | 316 FLAGS_quic_use_bbr_congestion_control ? kBBR : kCubic, |
| 318 FLAGS_quic_use_time_loss_detection ? kTime : kNack, | 317 FLAGS_quic_use_time_loss_detection ? kTime : kNack), |
| 319 is_secure), | |
| 320 version_negotiation_state_(START_NEGOTIATION), | 318 version_negotiation_state_(START_NEGOTIATION), |
| 321 perspective_(perspective), | 319 perspective_(perspective), |
| 322 connected_(true), | 320 connected_(true), |
| 323 peer_ip_changed_(false), | 321 peer_ip_changed_(false), |
| 324 peer_port_changed_(false), | 322 peer_port_changed_(false), |
| 325 self_ip_changed_(false), | 323 self_ip_changed_(false), |
| 326 self_port_changed_(false), | 324 self_port_changed_(false), |
| 327 can_truncate_connection_ids_(true), | 325 can_truncate_connection_ids_(true), |
| 328 is_secure_(is_secure), | |
| 329 mtu_discovery_target_(0), | 326 mtu_discovery_target_(0), |
| 330 mtu_probe_count_(0), | 327 mtu_probe_count_(0), |
| 331 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase), | 328 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase), |
| 332 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase), | 329 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase), |
| 333 largest_received_packet_size_(0), | 330 largest_received_packet_size_(0), |
| 334 goaway_sent_(false), | 331 goaway_sent_(false), |
| 335 goaway_received_(false) { | 332 goaway_received_(false) { |
| 336 DVLOG(1) << ENDPOINT << "Created connection with connection_id: " | 333 DVLOG(1) << ENDPOINT << "Created connection with connection_id: " |
| 337 << connection_id; | 334 << connection_id; |
| 338 framer_.set_visitor(this); | 335 framer_.set_visitor(this); |
| (...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2326 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2323 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
| 2327 ++mtu_probe_count_; | 2324 ++mtu_probe_count_; |
| 2328 | 2325 |
| 2329 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2326 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
| 2330 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2327 SendMtuDiscoveryPacket(mtu_discovery_target_); |
| 2331 | 2328 |
| 2332 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2329 DCHECK(!mtu_discovery_alarm_->IsSet()); |
| 2333 } | 2330 } |
| 2334 | 2331 |
| 2335 } // namespace net | 2332 } // namespace net |
| OLD | NEW |