mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 05:07:36 +03:00
don't retransmit Initial packets after receiving the first packet
This commit is contained in:
parent
d16dea09cc
commit
26013b8d64
2 changed files with 35 additions and 0 deletions
|
@ -755,6 +755,31 @@ var _ = Describe("Session", func() {
|
|||
Expect(sentPacket.EncryptionLevel).To(Equal(protocol.EncryptionForwardSecure))
|
||||
Expect(sentPacket.Length).To(BeEquivalentTo(len(<-mconn.written)))
|
||||
})
|
||||
|
||||
It("doesn't retransmit an initial packet if it already received a response", func() {
|
||||
sess.unpacker = &mockUnpacker{}
|
||||
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
||||
sph.EXPECT().GetLeastUnacked().AnyTimes()
|
||||
sph.EXPECT().DequeuePacketForRetransmission().Return(&ackhandler.Packet{
|
||||
PacketNumber: 10,
|
||||
PacketType: protocol.PacketTypeInitial,
|
||||
})
|
||||
sph.EXPECT().DequeuePacketForRetransmission()
|
||||
rph := mockackhandler.NewMockReceivedPacketHandler(mockCtrl)
|
||||
rph.EXPECT().ReceivedPacket(gomock.Any(), gomock.Any(), gomock.Any())
|
||||
rph.EXPECT().GetAckFrame()
|
||||
sess.receivedPacketHandler = rph
|
||||
sess.sentPacketHandler = sph
|
||||
err := sess.handlePacketImpl(&receivedPacket{
|
||||
header: &wire.Header{},
|
||||
data: []byte{0},
|
||||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(sess.receivedFirstPacket).To(BeTrue())
|
||||
sent, err := sess.sendPacket()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(sent).To(BeFalse())
|
||||
})
|
||||
})
|
||||
|
||||
Context("packet pacing", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue