mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 05:07:36 +03:00
never send 1-byte packet numbers
This commit is contained in:
parent
9bd9c8aa54
commit
eabd38238a
3 changed files with 13 additions and 15 deletions
|
@ -128,20 +128,20 @@ var _ = Describe("packet number calculation", func() {
|
|||
|
||||
Context("shortening a packet number for the publicHeader", func() {
|
||||
Context("shortening", func() {
|
||||
It("sends out low packet numbers as 1 byte", func() {
|
||||
It("sends out low packet numbers as 2 byte", func() {
|
||||
length := GetPacketNumberLengthForPublicHeader(4, 2)
|
||||
Expect(length).To(Equal(PacketNumberLen1))
|
||||
})
|
||||
|
||||
It("sends out high packet numbers as 1 byte, if all ACKs are received", func() {
|
||||
length := GetPacketNumberLengthForPublicHeader(0xDEADBEEF, 0xDEADBEEF-1)
|
||||
Expect(length).To(Equal(PacketNumberLen1))
|
||||
})
|
||||
|
||||
It("sends out higher packet numbers as 2 bytes, if a lot of ACKs are missing", func() {
|
||||
length := GetPacketNumberLengthForPublicHeader(200, 2)
|
||||
Expect(length).To(Equal(PacketNumberLen2))
|
||||
})
|
||||
|
||||
It("sends out high packet numbers as 2 byte, if all ACKs are received", func() {
|
||||
length := GetPacketNumberLengthForPublicHeader(0xDEADBEEF, 0xDEADBEEF-1)
|
||||
Expect(length).To(Equal(PacketNumberLen2))
|
||||
})
|
||||
|
||||
It("sends out higher packet numbers as 4 bytes, if a lot of ACKs are missing", func() {
|
||||
length := GetPacketNumberLengthForPublicHeader(40000, 2)
|
||||
Expect(length).To(Equal(PacketNumberLen4))
|
||||
})
|
||||
})
|
||||
|
||||
Context("self-consistency", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue