use the timer granularity as a minimum for the loss detection timer

This commit is contained in:
Marten Seemann
2019-04-16 11:34:07 +09:00
parent 2c27cc0090
commit 450d777a51

View File

@@ -342,6 +342,9 @@ func (h *sentPacketHandler) detectLostPackets(
maxRTT := float64(utils.MaxDuration(h.rttStats.LatestRTT(), h.rttStats.SmoothedRTT()))
lossDelay := time.Duration(timeThreshold * maxRTT)
// Minimum time of granularity before packets are deemed lost.
lossDelay = utils.MaxDuration(lossDelay, granularity)
var lostPackets []*Packet
pnSpace.history.Iterate(func(packet *Packet) (bool, error) {
if packet.PacketNumber > pnSpace.largestAcked {