improve logging of undecryptable packets

This commit is contained in:
Marten Seemann 2019-11-25 14:06:44 +07:00
parent dde21d2f72
commit 78029adfb2
3 changed files with 16 additions and 3 deletions

View file

@ -247,3 +247,11 @@ func (h *Header) ParseExtended(b *bytes.Reader, ver protocol.VersionNumber) (*Ex
func (h *Header) toExtendedHeader() *ExtendedHeader {
return &ExtendedHeader{Header: *h}
}
// PacketType is the type of the packet, for logging purposes
func (h *Header) PacketType() string {
if h.IsLongHeader {
return h.Type.String()
}
return "1-RTT"
}