Make the downloader use the aria2c wrapper instead of the aria2 library.

This commit is contained in:
Matthieu Gautier
2018-08-29 12:10:34 +02:00
parent 0a93cb0872
commit db9000f706
5 changed files with 48 additions and 94 deletions

View File

@ -21,15 +21,13 @@
#define KIWIX_DOWNLOADER_H
#include <string>
#ifdef ENABLE_LIBARIA2
# include <aria2/aria2.h>
#endif
#include <pthread.h>
#include <memory>
namespace kiwix
{
class Aria2;
struct DownloadedFile {
DownloadedFile()
: success(false) {}
@ -56,17 +54,8 @@ class Downloader
DownloadedFile download(const std::string& url);
private:
static pthread_mutex_t globalLock;
std::string tmpDir;
#ifdef ENABLE_LIBARIA2
DownloadedFile* fileHandle;
aria2::Session* session;
static int downloadEventCallback(aria2::Session* session,
aria2::DownloadEvent event,
aria2::A2Gid gid,
void* userData);
#endif
std::unique_ptr<Aria2> mp_aria;
};
}