* Room server fix: re-tries for pushPostToClient() used to have same packet hash

This commit is contained in:
Scott Powell
2025-06-02 22:19:46 +10:00
parent 1ba69f3b8d
commit 8cf20c7c24

View File

@@ -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