fix: abgewiesener fw_update verdirbt last_ota_error des laufenden Updates nicht mehr

Ein zweiter fw_update waehrend eines laufenden Downloads setzte s_error
auf "busy". Da ota_task() nur bei leerem Fehlerfeld auf "download"
zurueckfaellt, wurde ein spaeter gescheiterter Transfer danach als
"busy" gemeldet statt als "download". Die Abweisung hat kein eigenes
Ergebnis - sie wird der API mit 409 gemeldet, last_ota_error bleibt beim
Ergebnis des laufenden bzw. letzten Updates.

Dazu die Doku auf das am EVK gemessene Verhalten korrigiert: stirbt die
Gegenstelle mitten im Download, haengt der Lesevorgang rund sieben
Minuten in einem TCP-Timeout und bricht ohne Range-Resume ab.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Michael Sauer
2026-09-12 10:58:09 +02:00
co-authored by Claude Opus 5
parent 6adf22fb52
commit 5e2dff375e
5 changed files with 23 additions and 12 deletions
+3 -3
View File
@@ -339,9 +339,9 @@ static void handle_command(const nl_api_ctx_t *ctx, const nl_http_request_t *req
else if (ctx->fw_update(url) != 0) {
/* fw_update() itself can genuinely fail now (busy, or a rejected URL) - 409 with the
* reason, not a blanket "not implemented". */
nl_sys_info_t in;
ctx->get_info(&in);
reply_error(resp, 409, in.last_ota_error ? in.last_ota_error : "fw_update busy or invalid url");
/* Do not reuse last_ota_error for this message: it belongs to the running or last
* update, not to the request we are rejecting right now. */
reply_error(resp, 409, "an update is already running");
} else
reply(resp, 202, "{\"status\":\"updating\"}");
} else if (strcmp(type, "reboot") == 0) {