fix data invalid bug.

This commit is contained in:
alves
2026-02-25 19:15:59 +08:00
parent fa8aa5682b
commit 75a75bb776

View File

@@ -681,7 +681,7 @@ bool PresetUpdater::priv::download_file(const std::string& url,
.on_error([&url](std::string body, std::string error, unsigned http_status) {
BOOST_LOG_TRIVIAL(error) << "Download failed: " << url << ", HTTP status: " << http_status << ", error: " << error;
})
.on_complete([&](std::string body, unsigned http_status) {
.on_complete([&, target_path, extract_path, tmp_path](std::string body, unsigned http_status) {
if (http_status != 200) {
BOOST_LOG_TRIVIAL(error) << "Download failed with HTTP status: " << http_status;
return;
@@ -707,7 +707,7 @@ bool PresetUpdater::priv::download_file(const std::string& url,
}
extract_file(target_path, extract_path);
BOOST_LOG_TRIVIAL(info) << "Download completed: " << target_path;
res = true;
})
.timeout_max(timeout_sec)
.perform();