Index: net/quic/congestion_control/tcp_loss_algorithm.cc |
diff --git a/net/quic/congestion_control/tcp_loss_algorithm.cc b/net/quic/congestion_control/tcp_loss_algorithm.cc |
index 8dad3f18429279d8401424d3c727657b9767401a..557681ee1864932a3da015054e208e03a97a259f 100644 |
--- a/net/quic/congestion_control/tcp_loss_algorithm.cc |
+++ b/net/quic/congestion_control/tcp_loss_algorithm.cc |
@@ -37,33 +37,34 @@ SequenceNumberSet TCPLossAlgorithm::DetectLostPackets( |
loss_detection_timeout_ = QuicTime::Zero(); |
QuicTime::Delta loss_delay = |
rtt_stats.SmoothedRtt().Multiply(kEarlyRetransmitLossDelayMultiplier); |
- |
+ QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); |
for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); |
- it != unacked_packets.end() && it->first <= largest_observed; ++it) { |
- if (!it->second.in_flight) { |
+ it != unacked_packets.end() && sequence_number <= largest_observed; |
+ ++it, ++sequence_number) { |
+ if (!it->in_flight) { |
continue; |
} |
- LOG_IF(DFATAL, it->second.nack_count == 0) |
+ LOG_IF(DFATAL, it->nack_count == 0) |
<< "All packets less than largest observed should have been nacked."; |
- if (it->second.nack_count >= kNumberOfNacksBeforeRetransmission) { |
- lost_packets.insert(it->first); |
+ if (it->nack_count >= kNumberOfNacksBeforeRetransmission) { |
+ lost_packets.insert(sequence_number); |
continue; |
} |
// Only early retransmit(RFC5827) when the last packet gets acked and |
// there are retransmittable packets in flight. |
// This also implements a timer-protected variant of FACK. |
- if (it->second.retransmittable_frames && |
+ if (it->retransmittable_frames && |
unacked_packets.largest_sent_packet() == largest_observed) { |
// Early retransmit marks the packet as lost once 1.25RTTs have passed |
// since the packet was sent and otherwise sets an alarm. |
- if (time >= it->second.sent_time.Add(loss_delay)) { |
- lost_packets.insert(it->first); |
+ if (time >= it->sent_time.Add(loss_delay)) { |
+ lost_packets.insert(sequence_number); |
} else { |
// Set the timeout for the earliest retransmittable packet where early |
// retransmit applies. |
- loss_detection_timeout_ = it->second.sent_time.Add(loss_delay); |
+ loss_detection_timeout_ = it->sent_time.Add(loss_delay); |
break; |
} |
} |