mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 17:40:26 -05:00
Work on http download interface
This commit is contained in:
@@ -153,9 +153,14 @@ bool HttpSynchronization::trySyncFromUrl(std::string listUrl) {
|
||||
opt.requestTimeoutSeconds = 0;
|
||||
|
||||
SyncHttpMemoryDownload fileListDownload(listUrl);
|
||||
fileListDownload.onProgress([this](HttpRequest::Progress p) {
|
||||
return !_shouldCancel;
|
||||
});
|
||||
fileListDownload.download(opt);
|
||||
|
||||
// ...
|
||||
if (!fileListDownload.hasSucceeded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::vector<char>& buffer = fileListDownload.downloadedData();
|
||||
|
||||
@@ -177,6 +182,7 @@ bool HttpSynchronization::trySyncFromUrl(std::string listUrl) {
|
||||
});
|
||||
downloadThreads.push_back(std::move(t));
|
||||
}
|
||||
|
||||
for (auto& t : downloadThreads) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user