| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/congestion_control/tcp_loss_algorithm.h" | 5 #include "net/quic/congestion_control/tcp_loss_algorithm.h" |
| 6 | 6 |
| 7 #include "net/quic/congestion_control/rtt_stats.h" | 7 #include "net/quic/congestion_control/rtt_stats.h" |
| 8 #include "net/quic/quic_protocol.h" | 8 #include "net/quic/quic_protocol.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 QuicTime::Delta loss_delay = | 33 QuicTime::Delta loss_delay = |
| 34 rtt_stats.smoothed_rtt().Multiply(kEarlyRetransmitLossDelayMultiplier); | 34 rtt_stats.smoothed_rtt().Multiply(kEarlyRetransmitLossDelayMultiplier); |
| 35 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); | 35 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); |
| 36 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); | 36 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); |
| 37 it != unacked_packets.end() && sequence_number <= largest_observed; | 37 it != unacked_packets.end() && sequence_number <= largest_observed; |
| 38 ++it, ++sequence_number) { | 38 ++it, ++sequence_number) { |
| 39 if (!it->in_flight) { | 39 if (!it->in_flight) { |
| 40 continue; | 40 continue; |
| 41 } | 41 } |
| 42 | 42 |
| 43 LOG_IF(DFATAL, it->nack_count == 0) | 43 LOG_IF(DFATAL, it->nack_count == 0 && it->sent_time.IsInitialized()) |
| 44 << "All packets less than largest observed should have been nacked." | 44 << "All packets less than largest observed should have been nacked." |
| 45 << "sequence_number:" << sequence_number | 45 << "sequence_number:" << sequence_number |
| 46 << " largest_observed:" << largest_observed; | 46 << " largest_observed:" << largest_observed; |
| 47 if (it->nack_count >= kNumberOfNacksBeforeRetransmission) { | 47 if (it->nack_count >= kNumberOfNacksBeforeRetransmission) { |
| 48 lost_packets.insert(sequence_number); | 48 lost_packets.insert(sequence_number); |
| 49 continue; | 49 continue; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Only early retransmit(RFC5827) when the last packet gets acked and | 52 // Only early retransmit(RFC5827) when the last packet gets acked and |
| 53 // there are retransmittable packets in flight. | 53 // there are retransmittable packets in flight. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 return lost_packets; | 70 return lost_packets; |
| 71 } | 71 } |
| 72 | 72 |
| 73 QuicTime TCPLossAlgorithm::GetLossTimeout() const { | 73 QuicTime TCPLossAlgorithm::GetLossTimeout() const { |
| 74 return loss_detection_timeout_; | 74 return loss_detection_timeout_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace net | 77 } // namespace net |
| OLD | NEW |