self-limiting handlers fix

This commit is contained in:
liquidraver
2026-09-20 22:21:29 +02:00
parent bf3dad8737
commit ad23dcbdb6
4 changed files with 42 additions and 7 deletions
+6
View File
@@ -1030,11 +1030,17 @@ void RoomServerMesh::handleCommand(uint32_t sender_timestamp, char* command, cha
while (*command == ' ') command++;
uint8_t hdr_used = 0;
if (strlen(command) > 4 && command[2] == '|') {
memcpy(reply, command, 3);
reply += 3;
command += 3;
hdr_used = 3;
}
/* Tell the shared CLI how much of the caller's buffer is already spent, so
* the self-limiting handlers do not write past temp[5 + CLI_REMOTE_REPLY_SIZE].
* Set unconditionally: a stale value would shrink the next reply. */
_cli.setReplyHeaderUsed(hdr_used);
// ACL commands - supports BOTH formats for app compatibility:
// Old Arduino: setperm {pubkey-hex} {permissions} (pubkey is long, perms is short)