diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-03-06 15:17:08 +0000 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-03-06 15:17:08 +0000 |
commit | ba0767477d58033824fb3a48134a0b4c14100d24 (patch) | |
tree | e09471953b4cd85af8b04428525bd4d6a9400219 /src/common/download.h | |
parent | Merge pull request #1848 (diff) | |
parent | rpc: fix BUILD_TAG mispelling (BUILDTAG) (diff) | |
download | monero-ba0767477d58033824fb3a48134a0b4c14100d24.tar.xz |
Merge pull request #1841
b553c282 rpc: fix BUILD_TAG mispelling (BUILDTAG) (moneromooo-monero)
02097c87 core: print the "new update found" message in cyan, for visibility (moneromooo-monero)
749ebace download: check available disk space before downloading (moneromooo-monero)
f36c5f1e download: give download threads distinct names (moneromooo-monero)
f6211322 core: make update download cancellable (moneromooo-monero)
63f0e074 download: async API (moneromooo-monero)
9bf017ed http_client: allow cancelling a download (moneromooo-monero)
0d90123c http_client: allow derived class to get headers at start (moneromooo-monero)
Diffstat (limited to 'src/common/download.h')
-rw-r--r-- | src/common/download.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/download.h b/src/common/download.h index ab7644689..917cb2278 100644 --- a/src/common/download.h +++ b/src/common/download.h @@ -32,5 +32,13 @@ namespace tools { - bool download(const std::string &path, const std::string &url); + struct download_thread_control; + typedef std::shared_ptr<download_thread_control> download_async_handle; + + bool download(const std::string &path, const std::string &url, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> progress = NULL); + download_async_handle download_async(const std::string &path, const std::string &url, std::function<void(const std::string&, const std::string&, bool)> result, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> progress = NULL); + bool download_error(const download_async_handle &h); + bool download_finished(const download_async_handle &h); + bool download_wait(const download_async_handle &h); + bool download_cancel(const download_async_handle &h); } |