implement parsing and writing of QUIC v2 packet headers

This commit is contained in:
Marten Seemann
2022-05-23 19:36:14 +02:00
parent 909a3a9093
commit f3744f6535
6 changed files with 164 additions and 46 deletions

View File

@@ -14,7 +14,7 @@ import (
// writePacket returns a new raw packet with the specified header and payload
func writePacket(hdr *wire.ExtendedHeader, data []byte) []byte {
buf := &bytes.Buffer{}
hdr.Write(buf, protocol.VersionTLS)
hdr.Write(buf, hdr.Version)
return append(buf.Bytes(), data...)
}