From 8cf20c7c240d87b87394debfc417651fac26e899 Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Mon, 2 Jun 2025 22:19:46 +1000 Subject: [PATCH] * Room server fix: re-tries for pushPostToClient() used to have same packet hash --- examples/simple_room_server/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/simple_room_server/main.cpp b/examples/simple_room_server/main.cpp index 5ba6cbca..219c73ab 100644 --- a/examples/simple_room_server/main.cpp +++ b/examples/simple_room_server/main.cpp @@ -204,7 +204,10 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks { void pushPostToClient(ClientInfo* client, PostInfo& post) { int len = 0; memcpy(&reply_data[len], &post.post_timestamp, 4); len += 4; // this is a PAST timestamp... but should be accepted by client - reply_data[len++] = (TXT_TYPE_SIGNED_PLAIN << 2); // 'signed' plain text + + uint8_t attempt; + getRNG()->random(&attempt, 1); // need this for re-tries, so packet hash (and ACK) will be different + reply_data[len++] = (TXT_TYPE_SIGNED_PLAIN << 2) | (attempt & 3); // 'signed' plain text // encode prefix of post.author.pub_key memcpy(&reply_data[len], post.author.pub_key, 4); len += 4; // just first 4 bytes