summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 2b0e3783..2d69b310 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -127,8 +127,8 @@ int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE;
127int errcode; 127int errcode;
128int invert_regex = 0; 128int invert_regex = 0;
129 129
130char *server_address; 130char *server_address = NULL;
131char *host_name; 131char *host_name = NULL;
132char *server_url = 0; 132char *server_url = 0;
133char server_ip[DEFAULT_BUFFER_SIZE]; 133char server_ip[DEFAULT_BUFFER_SIZE];
134struct curl_slist *server_ips = NULL; 134struct curl_slist *server_ips = NULL;
@@ -367,7 +367,7 @@ check_http (void)
367 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_TIMEOUT, socket_timeout), "CURLOPT_TIMEOUT"); 367 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_TIMEOUT, socket_timeout), "CURLOPT_TIMEOUT");
368 368
369 // fill dns resolve cache to make curl connect to the given server_address instead of the host_name, only required for ssl, because we use the host_name later on to make SNI happy 369 // fill dns resolve cache to make curl connect to the given server_address instead of the host_name, only required for ssl, because we use the host_name later on to make SNI happy
370 if(use_ssl) { 370 if(use_ssl && host_name != NULL) {
371 struct curl_slist *host = NULL; 371 struct curl_slist *host = NULL;
372 char dnscache[DEFAULT_BUFFER_SIZE]; 372 char dnscache[DEFAULT_BUFFER_SIZE];
373 snprintf (dnscache, DEFAULT_BUFFER_SIZE, "%s:%d:%s", host_name, server_port, server_address); 373 snprintf (dnscache, DEFAULT_BUFFER_SIZE, "%s:%d:%s", host_name, server_port, server_address);
@@ -380,7 +380,7 @@ check_http (void)
380 /* compose URL: use the address we want to connect to, set Host: header later */ 380 /* compose URL: use the address we want to connect to, set Host: header later */
381 snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s", 381 snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s",
382 use_ssl ? "https" : "http", 382 use_ssl ? "https" : "http",
383 use_ssl ? host_name : server_address, 383 use_ssl & host_name != NULL ? host_name : server_address,
384 server_port, 384 server_port,
385 server_url 385 server_url
386 ); 386 );