send packet numbers with 6byte for simpler session tests

This commit is contained in:
Lucas Clemente
2016-04-20 17:13:06 +02:00
parent 2e87459677
commit 6d9d9a1c29
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ func (h *PublicHeader) WritePublicHeader(b *bytes.Buffer) error {
b.WriteByte(publicFlagByte)
utils.WriteUint64(b, uint64(h.ConnectionID)) // TODO: Send shorter connection id if possible
utils.WriteUint32(b, uint32(h.PacketNumber)) // TODO: Send shorter packet number if possible
utils.WriteUint48(b, uint64(h.PacketNumber)) // TODO: Send shorter packet number if possible
return nil
}

View File

@@ -79,7 +79,7 @@ var _ = Describe("Public Header", func() {
PacketNumber: 2,
}
publicHeader.WritePublicHeader(b)
Expect(b.Bytes()).To(Equal([]byte{0x2c, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, 2, 0, 0, 0}))
Expect(b.Bytes()).To(Equal([]byte{0x2c, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, 2, 0, 0, 0, 0, 0}))
})
It("sets the Version Flag", func() {