From d25be05a94b90e9a7bfeb6e10e8e894494b3633f Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sat, 21 Dec 2024 14:17:13 +0100 Subject: [PATCH] Rebase cleanup --- cpr/ssl_ctx.cpp | 0 cpr/util.cpp | 2 ++ include/cpr/session.h | 2 ++ include/cpr/util.h | 2 ++ 4 files changed, 6 insertions(+) delete mode 100644 cpr/ssl_ctx.cpp diff --git a/cpr/ssl_ctx.cpp b/cpr/ssl_ctx.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/cpr/util.cpp b/cpr/util.cpp index dc02a339e..d2fb8bb9d 100644 --- a/cpr/util.cpp +++ b/cpr/util.cpp @@ -156,9 +156,11 @@ int debugUserFunction(CURL* /*handle*/, curl_infotype type, char* data, size_t s return 0; } +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION CURLcode sslCtxUserFunction(CURL* curl, void* sslctx, const ssl::SslCtxCallback* ctx) { return (*ctx)(curl, sslctx); } +#endif // SUPPORT_CURLOPT_SSL_CTX_FUNCTION /** * Creates a temporary CurlHolder object and uses it to escape the given string. diff --git a/include/cpr/session.h b/include/cpr/session.h index de124a381..3297dd2f7 100644 --- a/include/cpr/session.h +++ b/include/cpr/session.h @@ -251,7 +251,9 @@ class Session : public std::enable_shared_from_this { * Ensures that the "Transfer-Encoding" is set to "chunked", if not overriden in header_. **/ ReadCallback readcb_; +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION ssl::SslCtxCallback sslctxcb_; +#endif SUPPORT_CURLOPT_SSL_CTX_FUNCTION HeaderCallback headercb_; WriteCallback writecb_; ProgressCallback progresscb_; diff --git a/include/cpr/util.h b/include/cpr/util.h index 355482f73..369a0d742 100644 --- a/include/cpr/util.h +++ b/include/cpr/util.h @@ -19,7 +19,9 @@ size_t headerUserFunction(char* ptr, size_t size, size_t nmemb, const HeaderCall size_t writeFunction(char* ptr, size_t size, size_t nmemb, std::string* data); size_t writeFileFunction(char* ptr, size_t size, size_t nmemb, std::ofstream* file); size_t writeUserFunction(char* ptr, size_t size, size_t nmemb, const WriteCallback* write); +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION CURLcode sslCtxUserFunction(CURL* curl, void* sslctx, const ssl::SslCtxCallback* ctx); +#endif // SUPPORT_CURLOPT_SSL_CTX_FUNCTION template int progressUserFunction(const T* progress, cpr_pf_arg_t dltotal, cpr_pf_arg_t dlnow, cpr_pf_arg_t ultotal, cpr_pf_arg_t ulnow) {