forked from quic-go/quic-go
rename loss delay variable in sent packet handler
That's how it's called in the WG draft pseudo code.
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user