Commit graph

21 commits

Author SHA1 Message Date
Lorenz Kästle
35a1344995 check_curl: fix pointer type 2026-01-09 13:12:31 +01:00
Stuart Henderson
d36bf51baf fix types for most curl_easy_setopt parameters
according to https://curl.se/libcurl/c/curl_easy_setopt.html, parameters
are either a long, a function pointer, an object pointer or a curl_off_t,
depending on what the option expects; curl 8.16 checks and warns about
these.
2025-12-23 15:54:27 +00:00
Lorenz Kästle
db2983da7e
Fix/check curl sticky redir (#2188)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Spellcheck / codespell (push) Waiting to run
Tests / Running unit and integrationt tests (push) Waiting to run
Tests / Running rpm build test on almalinux:9 (push) Waiting to run
Tests / Running rpm build test on fedora:latest (push) Waiting to run
Tests / Running rpm build test on rockylinux:8 (push) Waiting to run
* check_curl: avoid freeing memory when we don't know where it came from

* check_curl: when using -f sticky conserve IPv6 addresses properly

When running the check on an ipv6 address with a sticky onredirect
policy like in this example:

  check_curl -6 -H example.com -I ::1 -f sticky

It results in a getaddrinfo error:

  HTTP CRITICAL - Unable to lookup IP address for '[::1]': getaddrinfo returned -3 - Temporary failure in name resolution

This happens because in check_http() if the content of server_addr is an
ipv6 address enclosing brackets are added and on redirection a
subsequent call to check_http() will pass this now bracketed value to
getaddrinfo resulting in the error.

To work around this, strip the brackets from the address prior to the
lookup_host() call.

* add Michael Jeanson to thanks
2025-11-28 12:21:08 +01:00
Lorenz Kästle
6abf609ed9 add some comments to explain changed code 2025-10-30 22:23:51 +01:00
Lorenz Kästle
669edf2afc check_curl: accept non standard compliant status line
If the status line from a server ended with '\n' instead
of '\r\n' (defined by RFC 9112), check_curl failed to parse it
and exited with an alarm.
The RFC recommends to be lenient here and this change follows that
suggestion.
2025-10-30 21:34:50 +01:00
Lorenz Kästle
5a2c1b2c3a Add output formatting option 2025-09-15 02:30:42 +02:00
Lorenz Kästle
afa81204dc check_curl: use new cert check function 2025-09-15 01:58:07 +02:00
Lorenz Kästle
9afb5e2a69 check_curl: remove display-html option 2025-09-13 12:28:49 +02:00
Lorenz Kästle
44b2a25a6b check_curl: implement new output mechanism 2025-09-12 16:37:24 +02:00
Lorenz Kästle
9c2ae47d44 check_curl: fix default redirect setting 2025-09-12 12:36:00 +02:00
Lorenz Kästle
ad4faf1a9a Fix struct access 2025-09-12 01:59:05 +02:00
Lorenz Kästle
ab66b41d23 check_curl: create outsourced helpers in extra files 2025-09-12 01:14:14 +02:00
Lorenz Kästle
99206dab7a check_curl: refactoring to modularize code 2025-09-11 13:44:55 +02:00
Lorenz Kästle
6969f57192 check_curl: improve option handling a bit 2025-09-11 11:24:16 +02:00
Lorenz Kästle
669441d16c check_curl: set http port to 80 by default 2025-09-10 11:39:42 +02:00
Lorenz Kästle
c06ea4e44c check_curl: pre compile regex for string matching 2025-09-10 11:08:52 +02:00
Lorenz Kästle
40b062f1bd check_curl: more refactoring 2025-09-09 15:12:03 +02:00
Lorenz Kästle
94ae1eccbc Fix some include paths 2025-09-09 02:07:55 +02:00
Lorenz Kästle
b54869391f Quick save 2025-08-01 14:29:48 +02:00
Lorenz Kästle
e570ce6363 check_curl: various small improvements 2025-07-14 23:35:52 +02:00
Lorenz Kästle
f25a4000b6 Refactor check_curl 2025-03-11 02:02:27 +01:00