ackhandler: fix qlogging of path probe timer resets and cancellations (#5003)

This commit is contained in:
Marten Seemann
2025-03-23 22:02:30 +07:00
committed by GitHub
parent 017ed984f3
commit 623e59b2a2

View File

@@ -584,14 +584,15 @@ func (h *sentPacketHandler) setLossDetectionTimer(now time.Time) {
newAlarm := h.lossDetectionTime(now)
h.alarm = newAlarm
if newAlarm.Time.IsZero() && !oldAlarm.Time.IsZero() {
hasAlarm := !newAlarm.Time.IsZero()
if !hasAlarm && !oldAlarm.Time.IsZero() {
h.logger.Debugf("Canceling loss detection timer.")
if h.tracer != nil && h.tracer.LossTimerCanceled != nil {
h.tracer.LossTimerCanceled()
}
}
if h.tracer != nil && h.tracer.SetLossTimer != nil && newAlarm != oldAlarm {
if hasAlarm && h.tracer != nil && h.tracer.SetLossTimer != nil && newAlarm != oldAlarm {
h.tracer.SetLossTimer(newAlarm.TimerType, newAlarm.EncryptionLevel, newAlarm.Time)
}
}
@@ -636,7 +637,7 @@ func (h *sentPacketHandler) lossDetectionTime(now time.Time) alarmTimer {
return alarmTimer{
Time: pathProbeLossTime,
TimerType: logging.TimerTypePathProbe,
EncryptionLevel: encLevel,
EncryptionLevel: protocol.Encryption1RTT,
}
}
return alarmTimer{}