Index: net/quic/core/congestion_control/general_loss_algorithm.cc |
diff --git a/net/quic/core/congestion_control/general_loss_algorithm.cc b/net/quic/core/congestion_control/general_loss_algorithm.cc |
index 6c82329ab058454db76f88d7ecd0a2fdea6e4498..6d7521c60361c249c92f9a6c5b65725b57341ee3 100644 |
--- a/net/quic/core/congestion_control/general_loss_algorithm.cc |
+++ b/net/quic/core/congestion_control/general_loss_algorithm.cc |
@@ -30,7 +30,8 @@ GeneralLossAlgorithm::GeneralLossAlgorithm() |
: loss_detection_timeout_(QuicTime::Zero()), |
largest_sent_on_spurious_retransmit_(0), |
loss_type_(kNack), |
- reordering_shift_(kDefaultLossDelayShift) {} |
+ reordering_shift_(kDefaultLossDelayShift), |
+ largest_previously_acked_(0) {} |
GeneralLossAlgorithm::GeneralLossAlgorithm(LossDetectionType loss_type) |
: loss_detection_timeout_(QuicTime::Zero()), |
@@ -38,7 +39,8 @@ GeneralLossAlgorithm::GeneralLossAlgorithm(LossDetectionType loss_type) |
loss_type_(loss_type), |
reordering_shift_(loss_type == kAdaptiveTime |
? kDefaultAdaptiveLossDelayShift |
- : kDefaultLossDelayShift) {} |
+ : kDefaultLossDelayShift), |
+ largest_previously_acked_(0) {} |
LossDetectionType GeneralLossAlgorithm::GetLossDetectionType() const { |
return loss_type_; |
@@ -51,6 +53,7 @@ void GeneralLossAlgorithm::SetLossDetectionType(LossDetectionType loss_type) { |
reordering_shift_ = loss_type == kAdaptiveTime |
? kDefaultAdaptiveLossDelayShift |
: kDefaultLossDelayShift; |
+ largest_previously_acked_ = 0; |
} |
// Uses nack counts to decide when packets are lost. |
@@ -81,6 +84,16 @@ void GeneralLossAlgorithm::DetectLosses( |
packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent)); |
continue; |
} |
+ } else if (loss_type_ == kLazyFack) { |
+ // Require two in order acks to invoke FACK, which avoids spuriously |
+ // retransmitting packets when one packet is reordered by a large amount. |
+ if (largest_newly_acked > largest_previously_acked_ && |
+ largest_previously_acked_ > packet_number && |
+ largest_previously_acked_ - packet_number >= |
+ (kNumberOfNacksBeforeRetransmission - 1)) { |
+ packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent)); |
+ continue; |
+ } |
} |
// Only early retransmit(RFC5827) when the last packet gets acked and |
@@ -108,6 +121,7 @@ void GeneralLossAlgorithm::DetectLosses( |
continue; |
} |
} |
+ largest_previously_acked_ = largest_newly_acked; |
} |
QuicTime GeneralLossAlgorithm::GetLossTimeout() const { |