mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-01 19:03:56 +01:00
The control server checks a request's token only after reading the whole line, and clients send the token last, so a local peer without it could make the app buffer a line of up to 256 MiB (512 MiB across connections). Until a request on a connection has passed the token check, a request line may be at most 64 KiB (control_token::MAX_UNAUTHENTICATED_LINE); a longer one gets an error reply and the connection is closed. After that the usual 256 MiB limit applies. The MCP bridge sends a short ping with the token before a longer request on a new connection, and sends the request only when the ping's reply shows the token check passed; a refused or lost ping leaves the request unsent and safe to retry. docs/control-protocol.md describes the limit. Part of #1925 (F-12). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>