re-write download code to support headers, needed for etag support.

etag support will be added later. github supports it and themezer probably does as well.
appstore does not sadly...
This commit is contained in:
ITotalJustice
2024-12-27 02:28:44 +00:00
parent 7005118876
commit 2edfe91ad6
10 changed files with 437 additions and 335 deletions

View File

@@ -30,6 +30,16 @@ struct ProgressBox final : Widget {
auto CopyFile(const fs::FsPath& src, const fs::FsPath& dst) -> Result;
void Yield();
auto OnDownloadProgressCallback() {
return [this](u32 dltotal, u32 dlnow, u32 ultotal, u32 ulnow){
if (this->ShouldExit()) {
return false;
}
this->UpdateTransfer(dlnow, dltotal);
return true;
};
}
public:
struct ThreadData {
ProgressBox* pbox;