Module: kamailio
Branch: master
Commit: 7cd32bf9631a81c7c4382d45f498bdc9c7f9b34c
URL:
https://github.com/kamailio/kamailio/commit/7cd32bf9631a81c7c4382d45f498bdc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-07-03T08:26:07+02:00
http_client: use LIBCURL_VERSION_NUM instead of CURL_AT_LEAST_VERSION
- older distros have compilers that don't cope with the later
---
Modified: src/modules/http_client/functions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7cd32bf9631a81c7c4382d45f498bdc…
Patch:
https://github.com/kamailio/kamailio/commit/7cd32bf9631a81c7c4382d45f498bdc…
---
diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c
index 118adc8656d..e09b3414d19 100644
--- a/src/modules/http_client/functions.c
+++ b/src/modules/http_client/functions.c
@@ -155,14 +155,16 @@ static int curL_request_url(struct sip_msg *_m, const char *_met,
res = curl_easy_setopt(curl, CURLOPT_URL, _url);
/* Limit to HTTP and HTTPS protocols */
-#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
+#if LIBCURL_VERSION_NUM >= 0x075500
+ /* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) */
res = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "http,https");
#else
res = curl_easy_setopt(
curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif
-#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
+#if LIBCURL_VERSION_NUM >= 0x075500
+ /* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) */
res = curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
#else
res = curl_easy_setopt(
@@ -392,7 +394,9 @@ static int curL_request_url(struct sip_msg *_m, const char *_met,
if((stat >= 200) && (stat < 500)) {
double datasize = 0;
-#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0)
+
+#if LIBCURL_VERSION_NUM >= 0x073700
+ /* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0) */
curl_off_t dlsize;
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dlsize);
download_size = (double)dlsize;