Improve OTA boundary handling

This commit is contained in:
robert committed 2026-07-02 12:22:39 +03:00
1 parent 28cd3439dd
commit 9d3926a25a
3 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -1030,7 +1030,7 @@ static void mg_upload_handler(struct mg_connection *c, int ev, void *ev_data) {
size_t alignment = 512;
size_t left = p->expected > p->received ? p->expected - p->received : 0;
size_t aligned = c->recv.len < left ? MG_ROUND_DOWN(c->recv.len, alignment)
: c->recv.len;
: left;
bool ok = true;
if (aligned > 0) {
if (p->fd != NULL) {