mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 05:07:36 +03:00
parent
fc8d937fce
commit
ff8c75a22e
3 changed files with 52 additions and 1 deletions
|
@ -2,6 +2,7 @@ package quic
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"math"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/ackhandler"
|
||||
"github.com/lucas-clemente/quic-go/frames"
|
||||
|
@ -703,4 +704,22 @@ var _ = Describe("Packet packer", func() {
|
|||
Expect(err).To(MatchError("PacketPacker BUG: Handshake retransmissions must contain a StopWaitingFrame"))
|
||||
})
|
||||
})
|
||||
|
||||
Context("packing ACK packets", func() {
|
||||
It("packs ACK packets", func() {
|
||||
p, err := packer.PackAckPacket(0, &frames.AckFrame{})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(p.frames).To(Equal([]frames.Frame{&frames.AckFrame{DelayTime: math.MaxInt64}}))
|
||||
})
|
||||
|
||||
It("packs ACK packets with SWFs", func() {
|
||||
packer.QueueControlFrameForNextPacket(&frames.StopWaitingFrame{})
|
||||
p, err := packer.PackAckPacket(0, &frames.AckFrame{})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(p.frames).To(Equal([]frames.Frame{
|
||||
&frames.AckFrame{DelayTime: math.MaxInt64},
|
||||
&frames.StopWaitingFrame{PacketNumber: 1, PacketNumberLen: 2},
|
||||
}))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue