From 4a75da930b6cdb6e9b1b17d19f9c9129cb9f2f41 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Thu, 28 Jan 2021 04:59:14 +0200 Subject: [PATCH] Modify CPR library to be able to access member variables for some types. --- module/Vendor/CPR/CMakeLists.txt | 12 +++++++++--- module/Vendor/CPR/include/cpr/cookies.h | 2 +- module/Vendor/CPR/include/cpr/parameters.h | 2 ++ module/Vendor/CPR/include/cpr/payload.h | 2 ++ module/Vendor/CPR/include/cpr/proxies.h | 2 +- module/Vendor/CPR/include/cpr/response.h | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/module/Vendor/CPR/CMakeLists.txt b/module/Vendor/CPR/CMakeLists.txt index 98fcfc89..de2e223c 100644 --- a/module/Vendor/CPR/CMakeLists.txt +++ b/module/Vendor/CPR/CMakeLists.txt @@ -35,8 +35,13 @@ cpr_option(BUILD_CPR_TESTS_SSL "Set to ON to build cpr ssl tests" ${BUILD_CPR_TE cpr_option(GENERATE_COVERAGE "Set to ON to generate coverage reports." OFF) cpr_option(CPR_CURL_NOSIGNAL "Set to ON to disable use of signals in libcurl." OFF) cpr_option(USE_SYSTEM_GTEST "If ON, this project will look in the system paths for an installed gtest library" OFF) -cpr_option(USE_OPENSSL "Use OpenSSL code. Experimental" ON) -cpr_option(USE_WINSSL "Use WIN_SSL backend. Experimental" OFF) +if(WIN32) + cpr_option(USE_OPENSSL "Use OpenSSL code. Experimental" OFF) + cpr_option(USE_WINSSL "Use WIN_SSL backend. Experimental" ON) +else() + cpr_option(USE_OPENSSL "Use OpenSSL code. Experimental" ON) + cpr_option(USE_WINSSL "Use WIN_SSL backend. Experimental" OFF) +endif() message(STATUS "=======================================================") if (USE_OPENSSL AND USE_WINSSL) @@ -96,7 +101,8 @@ if(NOT USE_SYSTEM_CURL OR NOT CURL_FOUND) endif() if(USE_WINSSL) - set(CMAKE_USE_WINSSL ON CACHE INTERNAL "" FORCE) + #set(CMAKE_USE_WINSSL ON CACHE INTERNAL "" FORCE) + set(CMAKE_USE_SCHANNEL ON CACHE INTERNAL "" FORCE) set(CURL_CA_PATH "none" CACHE INTERNAL "" FORCE) endif() diff --git a/module/Vendor/CPR/include/cpr/cookies.h b/module/Vendor/CPR/include/cpr/cookies.h index 03f70071..2c32035c 100644 --- a/module/Vendor/CPR/include/cpr/cookies.h +++ b/module/Vendor/CPR/include/cpr/cookies.h @@ -46,7 +46,7 @@ class Cookies { const_iterator cbegin() const; const_iterator cend() const; - private: + protected: std::map map_; }; diff --git a/module/Vendor/CPR/include/cpr/parameters.h b/module/Vendor/CPR/include/cpr/parameters.h index 0e34d4d7..0be195af 100644 --- a/module/Vendor/CPR/include/cpr/parameters.h +++ b/module/Vendor/CPR/include/cpr/parameters.h @@ -8,6 +8,8 @@ namespace cpr { class Parameters : public CurlContainer { + protected: + using CurlContainer::containerList_; public: Parameters() = default; Parameters(const std::initializer_list& parameters); diff --git a/module/Vendor/CPR/include/cpr/payload.h b/module/Vendor/CPR/include/cpr/payload.h index 686b540e..041513fa 100644 --- a/module/Vendor/CPR/include/cpr/payload.h +++ b/module/Vendor/CPR/include/cpr/payload.h @@ -8,6 +8,8 @@ namespace cpr { class Payload : public CurlContainer { + protected: + using CurlContainer::containerList_; public: template Payload(const It begin, const It end) { diff --git a/module/Vendor/CPR/include/cpr/proxies.h b/module/Vendor/CPR/include/cpr/proxies.h index 223a4cbd..565a63ef 100644 --- a/module/Vendor/CPR/include/cpr/proxies.h +++ b/module/Vendor/CPR/include/cpr/proxies.h @@ -14,7 +14,7 @@ class Proxies { bool has(const std::string& protocol) const; const std::string& operator[](const std::string& protocol); - private: + protected: std::map hosts_; }; } // namespace cpr diff --git a/module/Vendor/CPR/include/cpr/response.h b/module/Vendor/CPR/include/cpr/response.h index 3eed7bcc..bd3f25d4 100644 --- a/module/Vendor/CPR/include/cpr/response.h +++ b/module/Vendor/CPR/include/cpr/response.h @@ -18,7 +18,7 @@ namespace cpr { class Response { - private: + protected: std::shared_ptr curl_{nullptr}; public: