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 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (!SelectMutualVersion(packet.versions)) { | 393 if (!SelectMutualVersion(packet.versions)) { |
394 SendConnectionCloseWithDetails(QUIC_INVALID_VERSION, | 394 SendConnectionCloseWithDetails(QUIC_INVALID_VERSION, |
395 "no common version found"); | 395 "no common version found"); |
396 return; | 396 return; |
397 } | 397 } |
398 | 398 |
399 DVLOG(1) << ENDPOINT | 399 DVLOG(1) << ENDPOINT |
400 << "Negotiated version: " << QuicVersionToString(version()); | 400 << "Negotiated version: " << QuicVersionToString(version()); |
401 server_supported_versions_ = packet.versions; | 401 server_supported_versions_ = packet.versions; |
402 version_negotiation_state_ = NEGOTIATION_IN_PROGRESS; | 402 version_negotiation_state_ = NEGOTIATION_IN_PROGRESS; |
403 RetransmitUnackedPackets(ALL_PACKETS); | 403 RetransmitUnackedPackets(ALL_UNACKED_RETRANSMISSION); |
404 } | 404 } |
405 | 405 |
406 void QuicConnection::OnRevivedPacket() { | 406 void QuicConnection::OnRevivedPacket() { |
407 } | 407 } |
408 | 408 |
409 bool QuicConnection::OnUnauthenticatedPublicHeader( | 409 bool QuicConnection::OnUnauthenticatedPublicHeader( |
410 const QuicPacketPublicHeader& header) { | 410 const QuicPacketPublicHeader& header) { |
411 return true; | 411 return true; |
412 } | 412 } |
413 | 413 |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 pending.sequence_number, | 1255 pending.sequence_number, |
1256 serialized_packet.sequence_number); | 1256 serialized_packet.sequence_number); |
1257 | 1257 |
1258 SendOrQueuePacket(pending.retransmittable_frames.encryption_level(), | 1258 SendOrQueuePacket(pending.retransmittable_frames.encryption_level(), |
1259 serialized_packet, | 1259 serialized_packet, |
1260 pending.transmission_type); | 1260 pending.transmission_type); |
1261 } | 1261 } |
1262 } | 1262 } |
1263 | 1263 |
1264 void QuicConnection::RetransmitUnackedPackets( | 1264 void QuicConnection::RetransmitUnackedPackets( |
1265 RetransmissionType retransmission_type) { | 1265 TransmissionType retransmission_type) { |
1266 sent_packet_manager_.RetransmitUnackedPackets(retransmission_type); | 1266 sent_packet_manager_.RetransmitUnackedPackets(retransmission_type); |
1267 | 1267 |
1268 WriteIfNotBlocked(); | 1268 WriteIfNotBlocked(); |
1269 } | 1269 } |
1270 | 1270 |
1271 void QuicConnection::NeuterUnencryptedPackets() { | 1271 void QuicConnection::NeuterUnencryptedPackets() { |
1272 sent_packet_manager_.NeuterUnencryptedPackets(); | 1272 sent_packet_manager_.NeuterUnencryptedPackets(); |
1273 // This may have changed the retransmission timer, so re-arm it. | 1273 // This may have changed the retransmission timer, so re-arm it. |
1274 QuicTime retransmission_time = sent_packet_manager_.GetRetransmissionTime(); | 1274 QuicTime retransmission_time = sent_packet_manager_.GetRetransmissionTime(); |
1275 retransmission_alarm_->Update(retransmission_time, | 1275 retransmission_alarm_->Update(retransmission_time, |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 } | 2007 } |
2008 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2008 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
2009 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2009 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
2010 return true; | 2010 return true; |
2011 } | 2011 } |
2012 } | 2012 } |
2013 return false; | 2013 return false; |
2014 } | 2014 } |
2015 | 2015 |
2016 } // namespace net | 2016 } // namespace net |
OLD | NEW |