tidy-up: miscellaneous

- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000
This commit is contained in:
Viktor Szakats 2026-03-09 12:27:12 +01:00
parent 3512b673dd
commit e0dd6eb4a4
No known key found for this signature in database
148 changed files with 612 additions and 684 deletions

View file

@ -47,11 +47,12 @@ struct cf_dns_ctx {
char hostname[1];
};
static struct cf_dns_ctx *
cf_dns_ctx_create(struct Curl_easy *data, uint8_t dns_queries,
const char *hostname, uint16_t port, uint8_t transport,
bool abstract_unix_socket,
struct Curl_dns_entry *dns)
static struct cf_dns_ctx *cf_dns_ctx_create(struct Curl_easy *data,
uint8_t dns_queries,
const char *hostname,
uint16_t port, uint8_t transport,
bool abstract_unix_socket,
struct Curl_dns_entry *dns)
{
struct cf_dns_ctx *ctx;
size_t hlen = strlen(hostname);
@ -399,7 +400,7 @@ static CURLcode cf_dns_conn_create(struct Curl_cfilter **pcf,
* there, thus overriding any defaults that might have been set above. */
hostname = ehost->name;
port = conn->bits.conn_to_port ?
conn->conn_to_port : (uint16_t)conn->remote_port;
conn->conn_to_port : (uint16_t)conn->remote_port;
}
if(!hostname) {
@ -500,9 +501,10 @@ CURLcode Curl_conn_dns_result(struct connectdata *conn, int sockindex)
return Curl_cf_dns_result(conn->cfilter[sockindex]);
}
static const struct Curl_addrinfo *
cf_dns_get_nth_ai(struct Curl_cfilter *cf, const struct Curl_addrinfo *ai,
int ai_family, unsigned int index)
static const struct Curl_addrinfo *cf_dns_get_nth_ai(
struct Curl_cfilter *cf,
const struct Curl_addrinfo *ai,
int ai_family, unsigned int index)
{
struct cf_dns_ctx *ctx = cf->ctx;
unsigned int i = 0;
@ -551,11 +553,10 @@ bool Curl_conn_dns_has_any_ai(struct Curl_easy *data, int sockindex)
* first "resolve" filter underneath `cf`. If the DNS resolving is
* not done yet or if no address for the family exists, returns NULL.
*/
const struct Curl_addrinfo *
Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
struct Curl_easy *data,
int ai_family,
unsigned int index)
const struct Curl_addrinfo *Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
struct Curl_easy *data,
int ai_family,
unsigned int index)
{
(void)data;
for(; cf; cf = cf->next) {
@ -576,15 +577,12 @@ Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
* first "resolve" filter at the connection. If the DNS resolving is
* not done yet or if no address for the family exists, returns NULL.
*/
const struct Curl_addrinfo *
Curl_conn_dns_get_ai(struct Curl_easy *data,
int sockindex,
int ai_family,
unsigned int index)
const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
int sockindex, int ai_family,
unsigned int index)
{
struct connectdata *conn = data->conn;
return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data,
ai_family, index);
return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data, ai_family, index);
}
#ifdef USE_HTTPSRR
@ -592,8 +590,8 @@ Curl_conn_dns_get_ai(struct Curl_easy *data,
* connection. If the DNS resolving is not done yet or if there
* is no HTTPS-RR info, returns NULL.
*/
const struct Curl_https_rrinfo *
Curl_conn_dns_get_https(struct Curl_easy *data, int sockindex)
const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
int sockindex)
{
struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
for(; cf; cf = cf->next) {