From daf36365a809b87f627caa0e5f2c68b3ff235b5d Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 21 Jun 2021 20:29:38 +0200 Subject: [PATCH] Only use hardcoded libcurl paths as fallback --- src/curl-helper.cpp | 11 +++++++++++ src/headers/curl-helper.hpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/curl-helper.cpp b/src/curl-helper.cpp index 4039246f..87fdac71 100644 --- a/src/curl-helper.cpp +++ b/src/curl-helper.cpp @@ -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__) diff --git a/src/headers/curl-helper.hpp b/src/headers/curl-helper.hpp index d8496cc0..461e81f3 100644 --- a/src/headers/curl-helper.hpp +++ b/src/headers/curl-helper.hpp @@ -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);