[http_request] Call container->end() on non-OK status, fix comment

Address Copilot review feedback:
- Call container->end() when status_code != HTTP_STATUS_OK (pre-existing
  bug, but easy to fix while we're here)
- Update error_str comment to say "update check failure" not "fetch failure"
This commit is contained in:
J. Nick Koston
2026-03-17 18:33:55 -10:00
parent e93e064304
commit 564128127b
2 changed files with 3 additions and 1 deletions
@@ -85,6 +85,8 @@ void HttpRequestUpdate::update_task(void *params) {
if (container == nullptr || container->status_code != HTTP_STATUS_OK) {
ESP_LOGE(TAG, "Failed to fetch manifest from %s", this_update->source_url_.c_str());
if (container != nullptr)
container->end();
info->error_str = LOG_STR("Failed to fetch manifest");
goto defer; // NOLINT(cppcoreguidelines-avoid-goto)
}
+1 -1
View File
@@ -16,7 +16,7 @@ struct UpdateInfo {
std::string release_url;
std::string firmware_url;
std::string md5;
const LogString *error_str{nullptr}; // Set on fetch failure, nullptr on success
const LogString *error_str{nullptr}; // Set on update check failure, nullptr on success
bool has_progress{false};
float progress;
};