remove the LongHeader field from the wire.Header

This commit is contained in:
Marten Seemann 2022-12-27 12:03:38 +13:00
parent aca052dc7c
commit 86edf7fd4b
23 changed files with 154 additions and 363 deletions

View file

@ -38,7 +38,7 @@ var _ = Describe("0-RTT", func() {
if !wire.IsLongHeaderPacket(data[0]) {
break
}
hdr, _, rest, err := wire.ParsePacket(data, 0)
hdr, _, rest, err := wire.ParsePacket(data)
Expect(err).ToNot(HaveOccurred())
if hdr.Type == protocol.PacketType0RTT {
atomic.AddUint32(&num0RTTPackets, 1)
@ -351,7 +351,7 @@ var _ = Describe("0-RTT", func() {
RemoteAddr: fmt.Sprintf("localhost:%d", ln.Addr().(*net.UDPAddr).Port),
DelayPacket: func(_ quicproxy.Direction, data []byte) time.Duration {
if wire.IsLongHeaderPacket(data[0]) {
hdr, _, _, err := wire.ParsePacket(data, 0)
hdr, _, _, err := wire.ParsePacket(data)
Expect(err).ToNot(HaveOccurred())
if hdr.Type == protocol.PacketType0RTT {
atomic.AddUint32(&num0RTTPackets, 1)
@ -363,7 +363,7 @@ var _ = Describe("0-RTT", func() {
if !wire.IsLongHeaderPacket(data[0]) {
return false
}
hdr, _, _, err := wire.ParsePacket(data, 0)
hdr, _, _, err := wire.ParsePacket(data)
Expect(err).ToNot(HaveOccurred())
if hdr.Type == protocol.PacketType0RTT {
// drop 25% of the 0-RTT packets
@ -398,7 +398,7 @@ var _ = Describe("0-RTT", func() {
countZeroRTTBytes := func(data []byte) (n protocol.ByteCount) {
for len(data) > 0 {
hdr, _, rest, err := wire.ParsePacket(data, 0)
hdr, _, rest, err := wire.ParsePacket(data)
if err != nil {
return
}