summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-02-05 19:34:41 (GMT)
committerAndreas Baumann <mail@andreasbaumann.cc>2023-02-05 19:34:41 (GMT)
commit53f07a468db98247dc4012de0ee678f29cc2bfec (patch)
tree4f817bd385c1690955cfcc67bc531717949f75c6 /plugins/check_curl.c
parentfc8a233854c0d59cf637e982b84c836920d718bd (diff)
downloadmonitoring-plugins-53f07a468db98247dc4012de0ee678f29cc2bfec.tar.gz
using CURLOPT_REDIR_PROTOCOLS_STR instead of CURLOPT_REDIR_PROTOCOLS for curl >= 7.85.0
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index c6593df..7916eb5 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -688,9 +688,13 @@ check_http (void)
688 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_MAXREDIRS, max_depth+1), "CURLOPT_MAXREDIRS"); 688 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_MAXREDIRS, max_depth+1), "CURLOPT_MAXREDIRS");
689 689
690 /* for now allow only http and https (we are a http(s) check plugin in the end) */ 690 /* for now allow only http and https (we are a http(s) check plugin in the end) */
691#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 85, 0)
692 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"), "CURLOPT_REDIR_PROTOCOLS_STR");
693#else
691#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 4) 694#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 4)
692 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS), "CURLOPT_REDIRECT_PROTOCOLS"); 695 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS), "CURLOPT_REDIRECT_PROTOCOLS");
693#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 4) */ 696#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 4) */
697#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 85, 4) */
694 698
695 /* TODO: handle the following aspects of redirection, make them 699 /* TODO: handle the following aspects of redirection, make them
696 * command line options too later: 700 * command line options too later: