forked from quic-go/quic-go
fix ack frame length calculation for version <32
This commit is contained in:
@@ -99,6 +99,7 @@ func (f *AckFrame) MinLength() protocol.ByteCount {
|
||||
l += (1 + 2) * 0 /* TODO: num_timestamps */
|
||||
if f.HasNACK() {
|
||||
l += 1 + (6+1)*len(f.NackRanges)
|
||||
l++ // TODO: Remove once we drop support for <32
|
||||
}
|
||||
return protocol.ByteCount(l)
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ var _ = Describe("AckFrame", func() {
|
||||
LargestObserved: 4,
|
||||
NackRanges: []NackRange{NackRange{FirstPacketNumber: 2, LastPacketNumber: 2}},
|
||||
}
|
||||
err := f.Write(b, 1, protocol.PacketNumberLen6, 32)
|
||||
err := f.Write(b, 1, protocol.PacketNumberLen6, 31)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(f.MinLength()).To(Equal(protocol.ByteCount(b.Len())))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user