summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2017-05-28 10:49:53 +0200
committerSven Nierlein <sven@nierlein.de>2018-10-22 16:30:31 +0200
commit603dd23d116173f94669ee2d35ca89b8f7b362d6 (patch)
tree0481ef52e82f474acb54f977abd9f3fef364a0fe
parente09629ef65e91c56744c29fbee9ac6e6b24ed1db (diff)
downloadmonitoring-plugins-603dd23d116173f94669ee2d35ca89b8f7b362d6.tar.gz
check_curl: add legacy http request support
-rw-r--r--plugins/check_curl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index e7e05a53..da487504 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -372,14 +372,14 @@ check_http (void)
372#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 3) */ 372#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 3) */
373 373
374 /* extract proxy information for legacy proxy https requests */ 374 /* extract proxy information for legacy proxy https requests */
375 if (!strcmp(http_method, "CONNECT")) { 375 if (!strcmp(http_method, "CONNECT") || strstr(server_url, "http") == server_url) {
376 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXY, server_address), "CURLOPT_PROXY"); 376 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXY, server_address), "CURLOPT_PROXY");
377 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXYPORT, (long)server_port), "CURLOPT_PROXYPORT"); 377 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXYPORT, (long)server_port), "CURLOPT_PROXYPORT");
378 if (verbose>=2) 378 if (verbose>=2)
379 printf ("* curl CURLOPT_PROXY: %s:%d\n", server_address, server_port); 379 printf ("* curl CURLOPT_PROXY: %s:%d\n", server_address, server_port);
380 http_method = "GET"; 380 http_method = "GET";
381 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, server_url), "CURLOPT_URL"); 381 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, server_url), "CURLOPT_URL");
382 //server_port = use_ssl ? HTTPS_PORT : HTTP_PORT; 382 virtual_port = use_ssl ? HTTPS_PORT : HTTP_PORT;
383 } else { 383 } else {
384 /* set port */ 384 /* set port */
385 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PORT, server_port), "CURLOPT_PORT"); 385 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PORT, server_port), "CURLOPT_PORT");