Lots of logging and cleanup.

This commit is contained in:
Henrik Rydgård
2025-04-07 21:40:01 +02:00
parent ec6ea05c9b
commit 5f7b698012
8 changed files with 135 additions and 58 deletions
+7
View File
@@ -89,12 +89,19 @@ std::shared_ptr<Request> RequestManager::StartDownload(std::string_view url, con
// to modify the calling code.
std::string contents;
if (File::ReadBinaryFileToString(cacheFile, &contents)) {
INFO_LOG(Log::sceNet, "Returning cached file for %.*s: %s", (int)url.size(), url.data(), cacheFile.c_str());
// All is well, but we've indented a bit much here.
dl.reset(new CachedRequest(RequestMethod::GET, url, "", nullptr, flags, contents));
newDownloads_.push_back(dl);
return dl;
} else {
INFO_LOG(Log::sceNet, "Failed reading from cache, proceeding with request");
}
} else {
INFO_LOG(Log::sceNet, "Cached file too old, proceeding with request");
}
} else {
INFO_LOG(Log::sceNet, "Failed to check time modified. Proceeding with request.");
}
// OK, didn't get it from cache, so let's continue with the download, putting it in the cache.