correct the bytes in flight when dropping crypto packets

This commit is contained in:
Marten Seemann
2019-05-30 01:47:03 +08:00
parent 5009f1cb19
commit ea33339d26
2 changed files with 5 additions and 0 deletions

View File

@@ -860,11 +860,13 @@ var _ = Describe("SentPacketHandler", func() {
p := ackElicitingPacket(&Packet{PacketNumber: i, EncryptionLevel: protocol.EncryptionHandshake})
handler.SentPacket(p)
}
Expect(handler.bytesInFlight).ToNot(BeZero())
handler.queuePacketForRetransmission(getPacket(1, protocol.EncryptionInitial), handler.getPacketNumberSpace(protocol.EncryptionInitial))
handler.queuePacketForRetransmission(getPacket(3, protocol.EncryptionHandshake), handler.getPacketNumberSpace(protocol.EncryptionHandshake))
handler.SetHandshakeComplete()
Expect(handler.initialPackets.history.Len()).To(BeZero())
Expect(handler.handshakePackets.history.Len()).To(BeZero())
Expect(handler.bytesInFlight).To(BeZero())
packet := handler.DequeuePacketForRetransmission()
Expect(packet).To(BeNil())
})