mirror of https://github.com/kiwix/libkiwix.git
Remove useless Aria2c error handling functions (#306)
Remove useless Aria2c error handling functions
This commit is contained in:
commit
94c47383a9
|
@ -97,7 +97,6 @@ class Downloader
|
|||
|
||||
size_t getNbDownload() { return m_knownDownloads.size(); }
|
||||
std::vector<std::string> getDownloadIds();
|
||||
const std::string &getAria2LaunchCmd();
|
||||
|
||||
private:
|
||||
std::map<std::string, std::unique_ptr<Download>> m_knownDownloads;
|
||||
|
|
|
@ -78,8 +78,9 @@ Aria2::Aria2():
|
|||
callCmd.push_back("--max-concurrent-downloads=42");
|
||||
callCmd.push_back("--rpc-max-request-size=6M");
|
||||
callCmd.push_back("--file-allocation=none");
|
||||
std::string launchCmd;
|
||||
for (auto &cmd : callCmd) {
|
||||
m_launchCmd.append(cmd).append(" ");
|
||||
launchCmd.append(cmd).append(" ");
|
||||
}
|
||||
mp_aria = Subprocess::run(callCmd);
|
||||
mp_curl = curl_easy_init();
|
||||
|
@ -108,7 +109,7 @@ Aria2::Aria2():
|
|||
}
|
||||
if (!watchdog) {
|
||||
curl_easy_cleanup(mp_curl);
|
||||
throw std::runtime_error("Cannot connect to aria2c rpc");
|
||||
throw std::runtime_error("Cannot connect to aria2c rpc. Aria2c launch cmd : " + launchCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ class Aria2
|
|||
std::string m_downloadDir;
|
||||
CURL* mp_curl;
|
||||
pthread_mutex_t m_lock;
|
||||
std::string m_launchCmd;
|
||||
|
||||
std::string doRequest(const MethodCall& methodCall);
|
||||
|
||||
|
@ -44,7 +43,6 @@ class Aria2
|
|||
void pause(const std::string& gid);
|
||||
void unpause(const std::string& gid);
|
||||
void remove(const std::string& gid);
|
||||
const std::string &getLaunchCmd() { return m_launchCmd; };
|
||||
};
|
||||
|
||||
}; //end namespace kiwix
|
||||
|
|
|
@ -163,11 +163,6 @@ std::vector<std::string> Downloader::getDownloadIds() {
|
|||
return ret;
|
||||
}
|
||||
|
||||
const std::string &Downloader::getAria2LaunchCmd()
|
||||
{
|
||||
return mp_aria->getLaunchCmd();
|
||||
}
|
||||
|
||||
Download* Downloader::startDownload(const std::string& uri)
|
||||
{
|
||||
for (auto& p: m_knownDownloads) {
|
||||
|
|
Loading…
Reference in New Issue