Module: kamailio
Branch: 5.7
Commit: 7630473f57c7c0ad600067cea7a89693d9926a81
URL:
https://github.com/kamailio/kamailio/commit/7630473f57c7c0ad600067cea7a8969…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-07-03T08:27:57+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
(cherry picked from commit 7cd32bf9631a81c7c4382d45f498bdc9c7f9b34c)
---
Modified: src/modules/http_client/functions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7630473f57c7c0ad600067cea7a8969…
Patch:
https://github.com/kamailio/kamailio/commit/7630473f57c7c0ad600067cea7a8969…
---
diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c
index 8b1f33d74ef..97eea368198 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;