summaryrefslogtreecommitdiff
path: root/filecache.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-23 21:07:03 +0000
committerGitHub <noreply@github.com>2021-01-23 21:07:03 +0000
commitb28bfd6f208bc04b4157130eabfcf61b1825570d (patch)
tree7c2f770d7cda4d48571c8df69dc7460f1aa7bea0 /filecache.cpp
parent547124c94f8808d6dca407af7b6eb0d29ac12e45 (diff)
downloadabaddon-portaudio-b28bfd6f208bc04b4157130eabfcf61b1825570d.tar.gz
abaddon-portaudio-b28bfd6f208bc04b4157130eabfcf61b1825570d.zip
remove cpr as a dependency (#21)
abstract away library usage
Diffstat (limited to 'filecache.cpp')
-rw-r--r--filecache.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/filecache.cpp b/filecache.cpp
index c0b2f36..1f4024f 100644
--- a/filecache.cpp
+++ b/filecache.cpp
@@ -51,10 +51,10 @@ void Cache::GetFileFromURL(std::string url, callback_type cb) {
if (m_canceled) return;
m_semaphore->wait();
if (m_canceled) return;
- const auto &r = cpr::Get(cpr::Url { url });
+ http::request req(http::REQUEST_GET, url);
m_semaphore->notify();
if (m_canceled) return;
- OnResponse(r);
+ OnResponse(req.execute());
});
m_futures.push_back(std::move(future));
}
@@ -79,7 +79,7 @@ void Cache::CleanupFutures() {
}
}
-void Cache::OnResponse(const cpr::Response &r) {
+void Cache::OnResponse(const http::response_type &r) {
CleanupFutures(); // see above comment
if (r.error || r.status_code > 300) return;