don't do anything when OnAlarm is called, but no packets are outstanding

When all outstanding are acknowledged, the alarm is canceled in
updateLossDetectionAlarm. This doesn't reset the timer in the session
though. When OnAlarm is called, we therefore need to make sure that
there are actually packets outstanding.
This commit is contained in:
Marten Seemann
2018-08-08 15:40:36 +07:00
parent 90e8d6cbeb
commit 5358831604
2 changed files with 20 additions and 7 deletions

View File

@@ -791,6 +791,11 @@ var _ = Describe("SentPacketHandler", func() {
Expect(handler.GetAlarmTimeout()).To(BeZero())
})
It("does nothing on OnAlarm if there are no outstanding packets", func() {
Expect(handler.OnAlarm()).To(Succeed())
Expect(handler.SendMode()).To(Equal(SendAny))
})
Context("TLPs", func() {
It("uses the RTT from RTT stats", func() {
rtt := 2 * time.Second