forked from quic-go/quic-go
set the packet type for handshake retransmissions
This commit is contained in:
@@ -214,6 +214,7 @@ func (p *packetPacker) packHandshakeRetransmission(packet *ackhandler.Packet) (*
|
||||
p.hasSentPacket = false
|
||||
}
|
||||
header := p.getHeader(packet.EncryptionLevel)
|
||||
header.Type = packet.PacketType
|
||||
var frames []wire.Frame
|
||||
if p.version.UsesStopWaitingFrames() { // for gQUIC: pack a STOP_WAITING first
|
||||
if p.stopWaiting == nil {
|
||||
|
||||
@@ -616,12 +616,14 @@ var _ = Describe("Packet packer", func() {
|
||||
|
||||
It("packs a retransmission for a packet sent with no encryption", func() {
|
||||
packet := &ackhandler.Packet{
|
||||
PacketType: protocol.PacketTypeHandshake,
|
||||
EncryptionLevel: protocol.EncryptionUnencrypted,
|
||||
Frames: []wire.Frame{sf},
|
||||
}
|
||||
p, err := packer.PackRetransmission(packet)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(p).To(HaveLen(1))
|
||||
Expect(p[0].header.Type).To(Equal(protocol.PacketTypeHandshake))
|
||||
Expect(p[0].frames).To(Equal([]wire.Frame{swf, sf}))
|
||||
Expect(p[0].encryptionLevel).To(Equal(protocol.EncryptionUnencrypted))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user