don't send the same StopWaitingFrame twice

fixes #229
This commit is contained in:
Marten Seemann
2016-07-30 14:15:45 +07:00
parent b7d2a76811
commit 71243ccccb
4 changed files with 77 additions and 17 deletions

View File

@@ -351,13 +351,11 @@ var _ = Describe("SentPacketHandler", func() {
})
Context("StopWaitings", func() {
It("does not get a StopWaiting if no ACKs haven't been received yet", func() {
Expect(handler.GetStopWaitingFrame()).To(BeNil())
})
It("gets a StopWaitingFrame", func() {
handler.LargestAcked = 1336
Expect(handler.GetStopWaitingFrame()).To(Equal(&frames.StopWaitingFrame{LeastUnacked: 1337}))
ack := frames.AckFrame{LargestAcked: 5, LowestAcked: 5}
err := handler.ReceivedAck(&ack, 1)
Expect(err).ToNot(HaveOccurred())
Expect(handler.GetStopWaitingFrame()).To(Equal(&frames.StopWaitingFrame{LeastUnacked: 6}))
})
})