mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
The multipart branch for /config tests authenticated before it touches anything; the branch for /upload does not, and the 401 for it is only raised further down at the dispatch. By then the request has already set config_upload, uptr, verify_crc, max_upload and pre_acc, and announced a firmware upload on the console. Those five are globals while the transfer state they steer is per connection, and the stack is built for ten connections, so a request that is about to be rejected can still retarget an upload another client is in the middle of: a configuration upload continues as a firmware one and its remaining parts are written to the staging area instead of the configuration sector. Apply the same test the neighbouring branch uses, before the assignments.