tidy-up: typos, comment nits

Closes #22294
This commit is contained in:
Viktor Szakats 2026-06-26 22:57:40 +02:00
parent 5c5334f831
commit b093d88447
No known key found for this signature in database
35 changed files with 91 additions and 90 deletions

View file

@ -531,7 +531,7 @@ static bool altsvc_parse_dest(const char **pp,
/* quoted string, with hostname or just :port ? */
if(curlx_str_single(pp, ':')) { /* is hostname:port ? */
if(curlx_str_single(pp, '[')) { /* DNS hostname/ipv4 */
if(curlx_str_single(pp, '[')) { /* DNS hostname/IPv4 */
if(curlx_str_until(pp, dsthost, MAX_ALTSVC_HOSTLEN, ':')) {
infof(data, "Bad alt-svc hostname, ignoring.");
return FALSE;

View file

@ -618,7 +618,7 @@ CURLcode Curl_async_getaddrinfo(struct Curl_easy *data,
return result;
#ifdef CURLRES_IPV6
/* Do not start an AAAA query for an ipv4 address when
/* Do not start an AAAA query for an IPv4 address when
* we will start an A query for it. */
if((async->dns_queries & CURL_DNSQ_AAAA) &&
!(async->is_ipv4addr && (async->dns_queries & CURL_DNSQ_A))) {

View file

@ -137,8 +137,8 @@ struct async_thrdd_item;
/* Context for threaded resolver */
struct async_thrdd_ctx {
struct async_thrdd_item *res_A; /* ipv4 result */
struct async_thrdd_item *res_AAAA; /* ipv6 result */
struct async_thrdd_item *res_A; /* IPv4 result */
struct async_thrdd_item *res_AAAA; /* IPv6 result */
#if defined(USE_HTTPSRR) && defined(USE_ARES)
struct {
ares_channel channel;

View file

@ -219,7 +219,7 @@ static bool cf_dns_ready_to_connect(struct Curl_cfilter *cf,
return TRUE;
#ifdef USE_CURL_ASYNC
else {
/* We want AAAA answer as we prefer ipv6. If a sub-filter desires
/* We want AAAA answer as we prefer IPv6. If a sub-filter desires
* HTTPS-RR, we check for that query as well. */
uint8_t wanted_answers = CURL_DNSQ_AAAA;
if(Curl_conn_cf_wants_httpsrr(cf, data))

View file

@ -650,7 +650,7 @@ static CURLcode Curl_sha512_256_update(void *context,
if(length == 0)
return CURLE_OK; /* Shortcut, do nothing */
/* Note: (count & (CURL_SHA512_256_BLOCK_SIZE-1))
/* Note: (count & (CURL_SHA512_256_BLOCK_SIZE - 1))
equals (count % CURL_SHA512_256_BLOCK_SIZE) for this block size. */
bytes_have = (unsigned int)(ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1));
ctx->count += length;

View file

@ -545,7 +545,7 @@ static struct trc_feat_def trc_feats[] = {
{ &Curl_trc_feat_ssls, TRC_CT_NETWORK },
#endif
#ifdef USE_SSH
{ &Curl_trc_feat_ssh, TRC_CT_PROTOCOL },
{ &Curl_trc_feat_ssh, TRC_CT_PROTOCOL },
#endif
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
{ &Curl_trc_feat_ws, TRC_CT_PROTOCOL },

View file

@ -187,18 +187,19 @@ static int inet_pton6(const char *src, unsigned char *dst)
return 1;
}
/* int inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* 1 if the address was valid for the specified address family
* 0 if the address was not valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* notice:
* On Windows we store the error in the thread errno, not
* in the Winsock error code. This is to avoid losing the
* actual last Winsock error. When this function returns
* -1, check errno not SOCKERRNO.
/*
* Convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
*
* Return:
* 1 if the address was valid for the specified address family
* 0 if the address was not valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
*
* On Windows we store the error in the thread errno, not in the Winsock error
* code. This is to avoid losing the actual last Winsock error. When this
* function returns NULL, check errno not SOCKERRNO.
*
* author:
* Paul Vixie, 1996.
*/

View file

@ -929,11 +929,11 @@ static CURLcode ftp_port_parse_string(struct Curl_easy *data,
#ifdef USE_IPV6
struct sockaddr_in6 * const sa6 = (void *)ss;
#endif
/* either ipv6 or (ipv4|domain|interface):port(-range) */
/* either IPv6 or (ipv4|domain|interface):port(-range) */
addrlen = ip_end - string_ftpport;
#ifdef USE_IPV6
if(curlx_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) {
/* ipv6 */
/* IPv6 */
addrlen = strlen(string_ftpport);
ip_end = NULL; /* this got no port ! */
}

View file

@ -91,7 +91,7 @@ struct Curl_addrinfo *Curl_sync_getaddrinfo(struct Curl_easy *data,
!defined(CURLRES_AMIGA)
/*
* Curl_ipv4_resolve_r() - ipv4 thread-safe resolver function.
* Curl_ipv4_resolve_r() - IPv4 thread-safe resolver function.
*
* This is used for both synchronous and asynchronous resolver builds,
* implying that only thread-safe code and function calls may be used.

View file

@ -2054,9 +2054,9 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data)
}
else {
/* This is the HTTP Host: header, so we want
* - for ipv6 origins: "[ipv6-address]" where the ipv6 address is
* - for IPv6 origins: "[ipv6-address]" where the IPv6 address is
* found in origin->hostname, stripped of zoneid/scopeid.
* - the (IDN converted) origin->hostname (DNS name or ipv4) otherwise.
* - the (IDN converted) origin->hostname (DNS name or IPv4) otherwise.
* Note: zoneid/scopeid only applies to local routing and has no
* meaning on the remote HTTP server (eg. would confuse it). */
bool ipv6 = (bool)data->state.origin->ipv6;

View file

@ -33,9 +33,9 @@ struct Curl_scheme;
struct Curl_peer {
const struct Curl_scheme *scheme; /* url scheme */
char *hostname; /* normalized hostname (IDN decoded when supported) */
char *zoneid; /* NULL or ipv6 zone identifier */
char *zoneid; /* NULL or IPv6 zone identifier */
uint32_t refcount; /* created with 1, freed when dropping to 0 */
uint32_t scopeid; /* != 0, ipv6 scope to use */
uint32_t scopeid; /* != 0, IPv6 scope to use */
uint16_t port;
BIT(unix_socket); /* hostname is a UDS path without the prefix */
BIT(abstract_uds); /* only TRUE when `unix_socket` also TRUE */
@ -47,12 +47,12 @@ struct Curl_peer {
* - `peer->user_hostname` is the passed `hostname`
* - `peer->hostname` is the normalized `hostname` via
* + IDN conversion if it has non-ASCII characters
* + stripping of surrounding '[]' for URL formatted ipv6 addresses
* + stripping of surrounding '[]' for URL formatted IPv6 addresses
* + the path alone in case of a unix domain socket, e.g. hostname
* starts with CURL_PEER_UDS_PREFIX and is longer
* Scans for IPv6 addresses even without surrounding '[]'.
* - `zoneid` ipv6 zone identifier or NULL
* - `scopeid` ipv6 scopeid of zoneid, when known.
* - `zoneid` IPv6 zone identifier or NULL
* - `scopeid` IPv6 scopeid of zoneid, when known.
*/
CURLcode Curl_peer_create(struct Curl_easy *data,
const struct Curl_scheme *scheme,

View file

@ -2054,7 +2054,7 @@ static CURLcode setopt_cptr_http_mqtt(struct Curl_easy *data,
* If the encoding is set to "" we use an Accept-Encoding header that
* encompasses all the encodings we support.
* If the encoding is set to NULL we do not send an Accept-Encoding header
* and ignore an received Content-Encoding header.
* and ignore any received Content-Encoding header.
*
*/
if(ptr && !*ptr) {
@ -2077,7 +2077,7 @@ static CURLcode setopt_cptr_http_mqtt(struct Curl_easy *data,
*/
result = Curl_setstropt(&s->str[STRING_AWS_SIGV4], ptr);
/*
* Basic been set by default it need to be unset here
* Basic has been set by default; it needs to be unset here.
*/
if(s->str[STRING_AWS_SIGV4])
s->httpauth = CURLAUTH_AWS_SIGV4;

View file

@ -361,7 +361,7 @@ static CURLproxycode socks4_resolving(struct socks_ctx *sx,
return CURLPX_SEND_REQUEST;
}
else {
/* No ipv4 address resolved */
/* No IPv4 address resolved */
failf(data, "SOCKS4 connection to %s not supported", sx->dest->hostname);
return CURLPX_RESOLVE_HOST;
}

View file

@ -876,10 +876,10 @@ static CURLcode cf_ngtcp2_on_session_reuse(struct Curl_cfilter *cf,
*do_early_data = TRUE;
}
}
else { /* h3_conn_init set, assume done */
ctx->use_earlydata = TRUE;
cf->connected = TRUE;
*do_early_data = TRUE;
else { /* init_h3_conn_cb not set, assume done */
ctx->use_earlydata = TRUE;
cf->connected = TRUE;
*do_early_data = TRUE;
}
}
#else /* not supported in the TLS backend */

View file

@ -2582,7 +2582,7 @@ static CURLcode myssh_connect(struct Curl_easy *data, bool *done)
return CURLE_FAILED_INIT;
}
/* For ipv6 origins, use the `user_hostname` that has the "[]" enclosure.
/* For IPv6 origins, use the `user_hostname` that has the "[]" enclosure.
* Otherwise, use `hostname` that is IDN converted. */
rc = ssh_options_set(sshc->ssh_session, SSH_OPTIONS_HOST,
conn->origin->ipv6 ?

View file

@ -2144,7 +2144,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data,
else if(dNSName || iPAddress) {
const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "hostname" :
(peer->type == CURL_SSL_PEER_IPV4) ?
"ipv4 address" : "ipv6 address";
"IPv4 address" : "IPv6 address";
infof(data, " subjectAltName does not match %s %s", tname,
peer->origin->user_hostname);
failf(data, "SSL: no alternative certificate subject name matches "