forked from quic-go/quic-go
add logging for the packet header
This commit is contained in:
@@ -3,6 +3,7 @@ package wire
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
@@ -233,3 +234,15 @@ func (h *Header) hasPacketNumber(packetSentBy protocol.Perspective) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (h *Header) logPublicHeader() {
|
||||
connID := "(omitted)"
|
||||
if !h.OmitConnectionID {
|
||||
connID = fmt.Sprintf("%#x", h.ConnectionID)
|
||||
}
|
||||
ver := "(unset)"
|
||||
if h.Version != 0 {
|
||||
ver = fmt.Sprintf("%s", h.Version)
|
||||
}
|
||||
utils.Debugf(" Public Header{ConnectionID: %s, PacketNumber: %#x, PacketNumberLen: %d, Version: %s, DiversificationNonce: %#v}", connID, h.PacketNumber, h.PacketNumberLen, ver, h.DiversificationNonce)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user