only set the destination connection ID for the Public Header

This commit is contained in:
Marten Seemann
2018-06-24 16:47:59 +07:00
parent c9a9b57030
commit fc57bf6c35
12 changed files with 31 additions and 62 deletions

View File

@@ -452,13 +452,13 @@ func (p *packetPacker) getHeader(encLevel protocol.EncryptionLevel) *wire.Header
header := &wire.Header{
DestConnectionID: p.destConnID,
SrcConnectionID: p.srcConnID,
PacketNumber: pnum,
PacketNumberLen: packetNumberLen,
}
if p.version.UsesTLS() && encLevel != protocol.EncryptionForwardSecure {
header.IsLongHeader = true
header.SrcConnectionID = p.srcConnID
// Set the payload len to maximum size.
// Since it is encoded as a varint, this guarantees us that the header will end up at most as big as GetLength() returns.
header.PayloadLen = p.maxPacketSize