forked from quic-go/quic-go
ackhandler: fix qlogging of path probe timer resets and cancellations (#5003)
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user