fix a packet packer race

This commit is contained in:
Lucas Clemente
2016-04-21 17:02:26 +02:00
parent b17d9a7e55
commit 49701139cc

View File

@@ -68,7 +68,7 @@ func (p *packetPacker) PackPacket() (*packedPacket, error) {
return nil, err
}
ciphertext := p.aead.Seal(p.lastPacketNumber, raw.Bytes(), payload)
ciphertext := p.aead.Seal(currentPacketNumber, raw.Bytes(), payload)
raw.Write(ciphertext)
if raw.Len() > protocol.MaxPacketSize {