add remote page loading

This commit is contained in:
2019-11-27 19:55:31 +01:00
parent 7701e6771b
commit 41579fa3c6
18 changed files with 373 additions and 41 deletions

View File

@@ -186,6 +186,7 @@ bool Asset::open_url(const std::string& url, std::function<bool(float)> progress
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &tmp_data);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler_asset);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
#ifdef __ANDROID__
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
@@ -221,7 +222,7 @@ std::future<bool>& Asset::open_url_async(const std::string& url,
m_stop_async = false;
remote_future = std::async([this, url, progress, complete] {
bool ok = open_url(url, progress);
if (ok && complete)
if (complete)
complete(ok);
return ok;
});