forked from quic-go/quic-go
add a string representation for the Long Header packet types
This commit is contained in:
@@ -159,7 +159,7 @@ func (h *Header) getHeaderLength() (protocol.ByteCount, error) {
|
||||
|
||||
func (h *Header) logHeader() {
|
||||
if h.IsLongHeader {
|
||||
utils.Debugf(" Long Header{Type: %#x, ConnectionID: %#x, PacketNumber: %#x, Version: %s}", h.Type, h.ConnectionID, h.PacketNumber, h.Version)
|
||||
utils.Debugf(" Long Header{Type: %s, ConnectionID: %#x, PacketNumber: %#x, Version: %s}", h.Type, h.ConnectionID, h.PacketNumber, h.Version)
|
||||
} else {
|
||||
connID := "(omitted)"
|
||||
if !h.OmitConnectionID {
|
||||
|
||||
@@ -389,12 +389,12 @@ var _ = Describe("IETF draft Header", func() {
|
||||
It("logs Long Headers", func() {
|
||||
(&Header{
|
||||
IsLongHeader: true,
|
||||
Type: 0x5,
|
||||
Type: protocol.PacketTypeHandshake,
|
||||
PacketNumber: 0x1337,
|
||||
ConnectionID: 0xdeadbeef,
|
||||
Version: 253,
|
||||
}).logHeader()
|
||||
Expect(string(buf.Bytes())).To(ContainSubstring("Long Header{Type: 0x5, ConnectionID: 0xdeadbeef, PacketNumber: 0x1337, Version: 253}"))
|
||||
Expect(string(buf.Bytes())).To(ContainSubstring("Long Header{Type: Handshake, ConnectionID: 0xdeadbeef, PacketNumber: 0x1337, Version: 253}"))
|
||||
})
|
||||
|
||||
It("logs Short Headers containing a connection ID", func() {
|
||||
|
||||
Reference in New Issue
Block a user