Don't call OnAlarm() if no alarm is set

This commit is contained in:
Lucas Clemente
2017-06-19 16:13:09 +02:00
parent 515f4b3dcd
commit 472f2b24c0

View File

@@ -293,7 +293,7 @@ runLoop:
}
now := time.Now()
if s.sentPacketHandler.GetAlarmTimeout().Before(now) {
if timeout := s.sentPacketHandler.GetAlarmTimeout(); !timeout.IsZero() && timeout.Before(now) {
// This could cause packets to be retransmitted, so check it before trying
// to send packets.
s.sentPacketHandler.OnAlarm()