diff --git a/internal/ackhandler/sent_packet_handler.go b/internal/ackhandler/sent_packet_handler.go index a0c244cd..841087c8 100644 --- a/internal/ackhandler/sent_packet_handler.go +++ b/internal/ackhandler/sent_packet_handler.go @@ -340,7 +340,7 @@ func (h *sentPacketHandler) detectLostPackets( pnSpace := h.getPacketNumberSpace(encLevel) maxRTT := float64(utils.MaxDuration(h.rttStats.LatestRTT(), h.rttStats.SmoothedRTT())) - delayUntilLost := time.Duration((1.0 + timeReorderingFraction) * maxRTT) + lossDelay := time.Duration((1.0 + timeReorderingFraction) * maxRTT) var lostPackets []*Packet pnSpace.history.Iterate(func(packet *Packet) (bool, error) { @@ -349,14 +349,14 @@ func (h *sentPacketHandler) detectLostPackets( } timeSinceSent := now.Sub(packet.SendTime) - if timeSinceSent > delayUntilLost { + if timeSinceSent > lossDelay { lostPackets = append(lostPackets, packet) } else if h.lossTime.IsZero() && encLevel == protocol.Encryption1RTT { if h.logger.Debug() { - h.logger.Debugf("\tsetting loss timer for packet %#x to %s (in %s)", packet.PacketNumber, delayUntilLost, delayUntilLost-timeSinceSent) + h.logger.Debugf("\tsetting loss timer for packet %#x to %s (in %s)", packet.PacketNumber, lossDelay, lossDelay-timeSinceSent) } // Note: This conditional is only entered once per call - h.lossTime = now.Add(delayUntilLost - timeSinceSent) + h.lossTime = now.Add(lossDelay - timeSinceSent) } return true, nil })