send retransmission in the right order

fixes #62
This commit is contained in:
Marten Seemann 2016-05-08 23:03:40 +07:00
parent 833475a2ed
commit dbcf5b8cce
3 changed files with 10 additions and 8 deletions

View file

@ -375,10 +375,10 @@ var _ = Describe("SentPacketHandler", func() {
})
It("keeps the packets in the right order", func() {
handler.nackPacket(2)
handler.nackPacket(2)
handler.nackPacket(4)
handler.nackPacket(4)
handler.nackPacket(2)
handler.nackPacket(2)
packet := handler.DequeuePacketForRetransmission()
Expect(packet.PacketNumber).To(Equal(protocol.PacketNumber(2)))
packet = handler.DequeuePacketForRetransmission()
@ -386,12 +386,12 @@ var _ = Describe("SentPacketHandler", func() {
})
It("only queues each packet once, regardless of the number of NACKs", func() {
handler.nackPacket(2)
handler.nackPacket(2)
handler.nackPacket(4)
handler.nackPacket(4)
handler.nackPacket(2)
handler.nackPacket(2)
handler.nackPacket(4)
handler.nackPacket(4)
_ = handler.DequeuePacketForRetransmission()
_ = handler.DequeuePacketForRetransmission()
Expect(handler.DequeuePacketForRetransmission()).To(BeNil())