parse the whole Long Header, if the version is known

This commit is contained in:
Marten Seemann 2018-11-25 17:41:45 +07:00
parent b740d57c61
commit 70ce6a5814
11 changed files with 312 additions and 318 deletions

View file

@ -23,10 +23,12 @@ var _ = Describe("QUIC Proxy", func() {
makePacket := func(p protocol.PacketNumber, payload []byte) []byte {
b := &bytes.Buffer{}
hdr := wire.ExtendedHeader{
PacketNumber: p,
PacketNumberLen: protocol.PacketNumberLen4,
DestConnectionID: protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef, 0, 0, 0x13, 0x37},
SrcConnectionID: protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef, 0, 0, 0x13, 0x37},
Header: wire.Header{
DestConnectionID: protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef, 0, 0, 0x13, 0x37},
SrcConnectionID: protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef, 0, 0, 0x13, 0x37},
},
PacketNumber: p,
PacketNumberLen: protocol.PacketNumberLen4,
}
Expect(hdr.Write(b, protocol.VersionWhatever)).To(Succeed())
raw := b.Bytes()