Only use hardcoded libcurl paths as fallback

This commit is contained in:
WarmUpTill 2021-06-21 20:29:38 +02:00 committed by WarmUpTill
parent cea4df90b1
commit daf36365a8
2 changed files with 13 additions and 2 deletions

View File

@ -33,6 +33,17 @@ bool resolveCurl()
bool loadCurl()
{
loaded_curl_lib = new QLibrary(curl_library_name, nullptr);
if (resolveCurl()) {
blog(LOG_INFO, "[adv-ss] found curl library");
return true;
} else {
delete loaded_curl_lib;
loaded_curl_lib = nullptr;
blog(LOG_WARNING,
"[adv-ss] couldn't find the curl library in PATH");
}
QStringList locations;
locations << QDir::currentPath();
#if defined(__linux__) || defined(__APPLE__)

View File

@ -5,9 +5,9 @@
#if defined(WIN32)
constexpr auto curl_library_name = "libcurl.dll";
#elif __APPLE__
#define curl_library_name "libcurl.4.dylib"
constexpr auto curl_library_name = "libcurl.4.dylib";
#else
#define curl_library_name "libcurl.so.4"
constexpr auto curl_library_name = "libcurl.so.4";
#endif
typedef CURL *(*initFunction)(void);