Implement simple file caching.

This commit is contained in:
Henrik Rydgård committed 2025-01-23 13:28:51 +01:00
1 parent e4d08407ab
commit 7f877bb16b
9 files changed
+83 -16

No files matched your search

+2 -1
View File
@@ -107,7 +107,8 @@ bool HTTPSRequest::Done() {
failed_ = true;
progress_.Update(bodyLength, bodyLength, true);
} else if (resultCode_ == 200) {
if (!outfile_.empty() && !buffer_.FlushToFile(outfile_)) {
bool clear = !(flags_ & RequestFlags::KeepInMemory);
if (!outfile_.empty() && !buffer_.FlushToFile(outfile_, clear)) {
ERROR_LOG(Log::IO, "Failed writing download to '%s'", outfile_.c_str());
}
progress_.Update(bodyLength, bodyLength, true);