| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (ContainsKey(ack_frame.missing_packets, sequence_number)) { | 278 if (ContainsKey(ack_frame.missing_packets, sequence_number)) { |
| 279 // Don't continue to increase the nack count for packets not in flight. | 279 // Don't continue to increase the nack count for packets not in flight. |
| 280 if (!it->in_flight) { | 280 if (!it->in_flight) { |
| 281 continue; | 281 continue; |
| 282 } | 282 } |
| 283 // Consider it multiple nacks when there is a gap between the missing | 283 // Consider it multiple nacks when there is a gap between the missing |
| 284 // packet and the largest observed, since the purpose of a nack | 284 // packet and the largest observed, since the purpose of a nack |
| 285 // threshold is to tolerate re-ordering. This handles both StretchAcks | 285 // threshold is to tolerate re-ordering. This handles both StretchAcks |
| 286 // and Forward Acks. | 286 // and Forward Acks. |
| 287 // The nack count only increases when the largest observed increases. | 287 // The nack count only increases when the largest observed increases. |
| 288 size_t min_nacks = ack_frame.largest_observed - sequence_number; | 288 QuicPacketCount min_nacks = ack_frame.largest_observed - sequence_number; |
| 289 // Truncated acks can nack the largest observed, so use a min of 1. | 289 // Truncated acks can nack the largest observed, so use a min of 1. |
| 290 if (min_nacks == 0) { | 290 if (min_nacks == 0) { |
| 291 min_nacks = 1; | 291 min_nacks = 1; |
| 292 } | 292 } |
| 293 unacked_packets_.NackPacket(sequence_number, min_nacks); | 293 unacked_packets_.NackPacket(sequence_number, min_nacks); |
| 294 continue; | 294 continue; |
| 295 } | 295 } |
| 296 // Packet was acked, so remove it from our unacked packet list. | 296 // Packet was acked, so remove it from our unacked packet list. |
| 297 DVLOG(1) << ENDPOINT << "Got an ack for packet " << sequence_number; | 297 DVLOG(1) << ENDPOINT << "Got an ack for packet " << sequence_number; |
| 298 // If data is associated with the most recent transmission of this | 298 // If data is associated with the most recent transmission of this |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 933 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
| 934 // the default granularity of the Linux kernel's FQ qdisc. | 934 // the default granularity of the Linux kernel's FQ qdisc. |
| 935 using_pacing_ = true; | 935 using_pacing_ = true; |
| 936 send_algorithm_.reset( | 936 send_algorithm_.reset( |
| 937 new PacingSender(send_algorithm_.release(), | 937 new PacingSender(send_algorithm_.release(), |
| 938 QuicTime::Delta::FromMilliseconds(1), | 938 QuicTime::Delta::FromMilliseconds(1), |
| 939 kInitialUnpacedBurst)); | 939 kInitialUnpacedBurst)); |
| 940 } | 940 } |
| 941 | 941 |
| 942 } // namespace net | 942 } // namespace net |
| OLD | NEW |