From f77585321fa665c95d1bdf88f9965fbfcb9695e7 Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Wed, 24 Jul 2024 11:24:12 +0200 Subject: [PATCH] Fix timestamp codec len calculation (#1258) --- commons/zenoh-codec/src/core/timestamp.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons/zenoh-codec/src/core/timestamp.rs b/commons/zenoh-codec/src/core/timestamp.rs index 3ec059ae1b..95149144dd 100644 --- a/commons/zenoh-codec/src/core/timestamp.rs +++ b/commons/zenoh-codec/src/core/timestamp.rs @@ -23,7 +23,8 @@ use crate::{LCodec, RCodec, WCodec, Zenoh080}; impl LCodec<&Timestamp> for Zenoh080 { fn w_len(self, x: &Timestamp) -> usize { - self.w_len(x.get_time().as_u64()) + self.w_len(x.get_id().size()) + let id = x.get_id(); + self.w_len(x.get_time().as_u64()) + self.w_len(&id.to_le_bytes()[..id.size()]) } }