Make naett work on Android, UWP, Mac. Exclude on Linux

This commit is contained in:
Henrik Rydgård committed 2023-07-21 10:28:31 +02:00
1 parent fbd980bee6
commit ab6e902fea
17 files changed
+104 -14

No files matched your search

+12
View File
@@ -13,7 +13,11 @@ bool RequestManager::IsHttpsUrl(const std::string &url) {
std::shared_ptr<Download> RequestManager::StartDownload(const std::string &url, const Path &outfile, ProgressBarMode mode, const char *acceptMime) {
std::shared_ptr<Download> dl;
if (IsHttpsUrl(url)) {
#ifndef HTTPS_NOT_AVAILABLE
dl.reset(new HTTPSDownload(RequestMethod::GET, url, "", "", outfile, mode));
#else
return std::shared_ptr<Download>();
#endif
} else {
dl.reset(new HTTPDownload(RequestMethod::GET, url, "", "", outfile, mode));
}
@@ -36,7 +40,11 @@ std::shared_ptr<Download> RequestManager::StartDownloadWithCallback(
const char *acceptMime) {
std::shared_ptr<Download> dl;
if (IsHttpsUrl(url)) {
#ifndef HTTPS_NOT_AVAILABLE
dl.reset(new HTTPSDownload(RequestMethod::GET, url, "", "", outfile, mode, name));
#else
return std::shared_ptr<Download>();
#endif
} else {
dl.reset(new HTTPDownload(RequestMethod::GET, url, "", "", outfile, mode, name));
}
@@ -59,7 +67,11 @@ std::shared_ptr<Download> RequestManager::AsyncPostWithCallback(
const std::string &name) {
std::shared_ptr<Download> dl;
if (IsHttpsUrl(url)) {
#ifndef HTTPS_NOT_AVAILABLE
dl.reset(new HTTPSDownload(RequestMethod::POST, url, postData, postMime, Path(), mode, name));
#else
return std::shared_ptr<Download>();
#endif
} else {
dl.reset(new HTTPDownload(RequestMethod::POST, url, postData, postMime, Path(), mode, name));
}