summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.d/check_curl_helpers.h
diff options
context:
space:
mode:
authorinqrphl <32687873+inqrphl@users.noreply.github.com>2026-06-17 23:26:04 +0200
committerGitHub <noreply@github.com>2026-06-17 23:26:04 +0200
commit605d59f957bc32e57adc0cd40f449ebe41c782ab (patch)
treeb201f0a06b5a73b777a25c6228dbc2b705860469 /plugins/check_curl.d/check_curl_helpers.h
parentd10e7324abcfd2b7d81c1c4fc19f2297a4f0caea (diff)
downloadmonitoring-plugins-605d59f957bc32e57adc0cd40f449ebe41c782ab.tar.gz
check_curl fix: populate the dns cache when hostname gets resolved locally (#2280)
* check_curl fix: populate the dns cache when hostname gets resolved locally due to a previous refactor, it would populate it when hostname wasnt getting resolved locally hostname_gets_resolved locally now assumes that resolving is local if proxy was unknown. previously was returning 0 instead of true, contradicting what it says fix a memory leak. server_address_clean was being assigned to another strndup result before being freed fix another memory leak, one path to return in hostname_gets_resolved_locally was not freeing up two variables improve logs and comments around hostname_gets_resolved_locally clang-format is applied * check_curl: fix typo in comment --------- Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
Diffstat (limited to 'plugins/check_curl.d/check_curl_helpers.h')
-rw-r--r--plugins/check_curl.d/check_curl_helpers.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/check_curl.d/check_curl_helpers.h b/plugins/check_curl.d/check_curl_helpers.h
index 55df9bc1..2f9b0d1c 100644
--- a/plugins/check_curl.d/check_curl_helpers.h
+++ b/plugins/check_curl.d/check_curl_helpers.h
@@ -127,9 +127,10 @@ mp_subcheck check_curl_certificate_checks(CURL *curl, X509 *cert, int warn_days_
127 int crit_days_till_exp); 127 int crit_days_till_exp);
128char *fmt_url(check_curl_working_state workingState); 128char *fmt_url(check_curl_working_state workingState);
129 129
130/* determine_hostname_resolver determines if the host or the proxy resolves the target hostname 130/* hostname_gets_resolved_locally determines if the host or the proxy resolves the target hostname.
131returns RESOLVE_LOCALLY if requester resolves the hostname locally, RESOLVE_REMOTELY if proxy 131This depends on proxy schema, forced proxy and noproxy hostnames, wildcarded hostnames, IP addresses
132resolves the hostname */ 132and IP CIDRs. Returns true if the host resolves the hostname locally, and false if proxy resolves
133the hostname */
133bool hostname_gets_resolved_locally(const check_curl_working_state working_state); 134bool hostname_gets_resolved_locally(const check_curl_working_state working_state);
134 135
135/* Checks if an IP is inside given CIDR region. Using /protocol_size or not specifying the prefix 136/* Checks if an IP is inside given CIDR region. Using /protocol_size or not specifying the prefix