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

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

Issue 1411063004: Remove insecure QUIC support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 transmission_type(transmission_type), 253 transmission_type(transmission_type),
254 original_packet_number(original_packet_number) {} 254 original_packet_number(original_packet_number) {}
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, Perspective perspective,
264 Perspective perspective,
265 bool is_secure,
266 const QuicVersionVector& supported_versions) 264 const QuicVersionVector& supported_versions)
267 : framer_(supported_versions, 265 : framer_(supported_versions, helper->GetClock()->ApproximateNow(),
268 helper->GetClock()->ApproximateNow(),
269 perspective), 266 perspective),
270 helper_(helper), 267 helper_(helper),
271 writer_(writer_factory.Create(this)), 268 writer_(writer_factory.Create(this)),
272 owns_writer_(owns_writer), 269 owns_writer_(owns_writer),
273 encryption_level_(ENCRYPTION_NONE), 270 encryption_level_(ENCRYPTION_NONE),
274 has_forward_secure_encrypter_(false), 271 has_forward_secure_encrypter_(false),
275 first_required_forward_secure_packet_(0), 272 first_required_forward_secure_packet_(0),
276 clock_(helper->GetClock()), 273 clock_(helper->GetClock()),
277 random_generator_(helper->GetRandomGenerator()), 274 random_generator_(helper->GetRandomGenerator()),
278 connection_id_(connection_id), 275 connection_id_(connection_id),
(...skipping 25 matching lines...) Expand all
304 visitor_(nullptr), 301 visitor_(nullptr),
305 debug_visitor_(nullptr), 302 debug_visitor_(nullptr),
306 packet_generator_(connection_id_, &framer_, random_generator_, this), 303 packet_generator_(connection_id_, &framer_, random_generator_, this),
307 fec_alarm_(helper->CreateAlarm(new FecAlarm(&packet_generator_))), 304 fec_alarm_(helper->CreateAlarm(new FecAlarm(&packet_generator_))),
308 idle_network_timeout_(QuicTime::Delta::Infinite()), 305 idle_network_timeout_(QuicTime::Delta::Infinite()),
309 overall_connection_timeout_(QuicTime::Delta::Infinite()), 306 overall_connection_timeout_(QuicTime::Delta::Infinite()),
310 time_of_last_received_packet_(clock_->ApproximateNow()), 307 time_of_last_received_packet_(clock_->ApproximateNow()),
311 time_of_last_sent_new_packet_(clock_->ApproximateNow()), 308 time_of_last_sent_new_packet_(clock_->ApproximateNow()),
312 packet_number_of_last_sent_packet_(0), 309 packet_number_of_last_sent_packet_(0),
313 sent_packet_manager_( 310 sent_packet_manager_(
314 perspective, 311 perspective, clock_, &stats_,
315 clock_,
316 &stats_,
317 FLAGS_quic_use_bbr_congestion_control ? kBBR : kCubic, 312 FLAGS_quic_use_bbr_congestion_control ? kBBR : kCubic,
318 FLAGS_quic_use_time_loss_detection ? kTime : kNack, 313 FLAGS_quic_use_time_loss_detection ? kTime : kNack),
319 is_secure),
320 version_negotiation_state_(START_NEGOTIATION), 314 version_negotiation_state_(START_NEGOTIATION),
321 perspective_(perspective), 315 perspective_(perspective),
322 connected_(true), 316 connected_(true),
323 peer_ip_changed_(false), 317 peer_ip_changed_(false),
324 peer_port_changed_(false), 318 peer_port_changed_(false),
325 self_ip_changed_(false), 319 self_ip_changed_(false),
326 self_port_changed_(false), 320 self_port_changed_(false),
327 can_truncate_connection_ids_(true), 321 can_truncate_connection_ids_(true),
328 is_secure_(is_secure),
329 mtu_discovery_target_(0), 322 mtu_discovery_target_(0),
330 mtu_probe_count_(0), 323 mtu_probe_count_(0),
331 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase), 324 packets_between_mtu_probes_(kPacketsBetweenMtuProbesBase),
332 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase), 325 next_mtu_probe_at_(kPacketsBetweenMtuProbesBase),
333 largest_received_packet_size_(0), 326 largest_received_packet_size_(0),
334 goaway_sent_(false), 327 goaway_sent_(false),
335 goaway_received_(false) { 328 goaway_received_(false) {
336 DVLOG(1) << ENDPOINT << "Created connection with connection_id: " 329 DVLOG(1) << ENDPOINT << "Created connection with connection_id: "
337 << connection_id; 330 << connection_id;
338 framer_.set_visitor(this); 331 framer_.set_visitor(this);
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2319 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2327 ++mtu_probe_count_; 2320 ++mtu_probe_count_;
2328 2321
2329 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2322 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2330 SendMtuDiscoveryPacket(mtu_discovery_target_); 2323 SendMtuDiscoveryPacket(mtu_discovery_target_);
2331 2324
2332 DCHECK(!mtu_discovery_alarm_->IsSet()); 2325 DCHECK(!mtu_discovery_alarm_->IsSet());
2333 } 2326 }
2334 2327
2335 } // namespace net 2328 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698