diff --git a/public_header.go b/public_header.go index 6c120f64..f55a0507 100644 --- a/public_header.go +++ b/public_header.go @@ -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 } diff --git a/public_header_test.go b/public_header_test.go index 15fde1de..48ca81e3 100644 --- a/public_header_test.go +++ b/public_header_test.go @@ -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() {