add a function to distinguish between long and short header packets (#3498)

This commit is contained in:
Marten Seemann 2022-08-11 16:35:01 +02:00 committed by GitHub
parent bebff462c8
commit 80fd1b57c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 11 deletions

View file

@ -453,7 +453,7 @@ var _ = Describe("Packet Handler Map", func() {
done := make(chan struct{})
conn.EXPECT().WriteTo(gomock.Any(), addr).Do(func(b []byte, _ net.Addr) {
defer close(done)
Expect(b[0] & 0x80).To(BeZero()) // short header packet
Expect(wire.IsLongHeaderPacket(b[0])).To(BeFalse()) // short header packet
Expect(b).To(HaveLen(protocol.MinStatelessResetSize))
})
handler.handlePacket(&receivedPacket{