add remote page loading
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user