mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
Implement simple file caching.
This commit is contained in:
1 parent
e4d08407ab
commit
7f877bb16b
9 files changed
+83
-16
No files matched your search
+6
-2
@@ -328,7 +328,7 @@ void StartInfraJsonDownload() {
|
||||
INFO_LOG(Log::sceNet, "json is already being downloaded");
|
||||
}
|
||||
const char *acceptMime = "application/json, text/*; q=0.9, */*; q=0.8";
|
||||
g_infraDL = g_DownloadManager.StartDownload("http://metadata.ppsspp.org/infra-dns.json", Path(), http::RequestFlags::Default, acceptMime);
|
||||
g_infraDL = g_DownloadManager.StartDownload("http://metadata.ppsspp.org/infra-dns.json", Path(), http::RequestFlags::Cached24H, acceptMime);
|
||||
}
|
||||
|
||||
bool PollInfraJsonDownload(std::string *jsonOutput) {
|
||||
@@ -359,9 +359,13 @@ bool PollInfraJsonDownload(std::string *jsonOutput) {
|
||||
}
|
||||
|
||||
// OK, we actually got data. Load it!
|
||||
INFO_LOG(Log::sceNet, "json downloaded");
|
||||
g_infraDL->buffer().TakeAll(jsonOutput);
|
||||
|
||||
if (jsonOutput->empty()) {
|
||||
_dbg_assert_msg_(false, "Json output is empty!");
|
||||
ERROR_LOG(Log::sceNet, "JSON output is empty! Something went wrong.");
|
||||
}
|
||||
|
||||
LoadAutoDNS(*jsonOutput);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user