forked from quic-go/quic-go
add a function to distinguish between long and short header packets (#3498)
This commit is contained in:
@@ -576,6 +576,11 @@ var _ = Describe("Header Parsing", func() {
|
||||
})
|
||||
})
|
||||
|
||||
It("distinguishes long and short header packets", func() {
|
||||
Expect(IsLongHeaderPacket(0x40)).To(BeFalse())
|
||||
Expect(IsLongHeaderPacket(0x80 ^ 0x40 ^ 0x12)).To(BeTrue())
|
||||
})
|
||||
|
||||
It("tells its packet type for logging", func() {
|
||||
Expect((&Header{IsLongHeader: true, Type: protocol.PacketTypeHandshake}).PacketType()).To(Equal("Handshake"))
|
||||
Expect((&Header{}).PacketType()).To(Equal("1-RTT"))
|
||||
|
||||
Reference in New Issue
Block a user