tidy-up: miscellaneous

- vms/curlmsg_vms.h: delete unused/commented code.
- vtls/schannel_verify: sort includes.
- typecheck-gcc.h: fix indent and alignment.
- lib/config-win32.h: drop idle `#undef`.
- spacecheck: check for stray empty lines before after curly braces.
- make literals more readable: 1048576 -> 1024 * 1024
- scope variables.
- use ISO date in a comment.
- drop redundant parentheses.
- drop empty comments.
- unfold lines.
- duplicate/stray spaces in comments.
- fix indent, whitespace, minor typos.

Closes #20690
This commit is contained in:
Viktor Szakats 2026-02-13 01:47:10 +01:00
parent ac46392f44
commit af78b199b2
No known key found for this signature in database
89 changed files with 424 additions and 448 deletions

View file

@ -229,7 +229,6 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file)
/*
* Write this single altsvc entry to a single output line
*/
static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
{
struct tm stamp;

View file

@ -600,8 +600,8 @@ async_ares_node2addr(struct ares_addrinfo_node *node)
for(ai = node; ai != NULL; ai = ai->ai_next) {
size_t ss_size;
struct Curl_addrinfo *ca;
/* ignore elements with unsupported address family, */
/* settle family-specific sockaddr structure size. */
/* ignore elements with unsupported address family,
settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
#ifdef USE_IPV6
@ -625,8 +625,8 @@ async_ares_node2addr(struct ares_addrinfo_node *node)
break;
}
/* copy each structure member individually, member ordering, */
/* size, or padding might be different for each platform. */
/* copy each structure member individually, member ordering,
size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;

View file

@ -117,7 +117,7 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf,
*/
/* data event arg1 arg2 return */
#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */
/* unused now 5 */
/* unused now 5 */
#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */
#define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */
#define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */
@ -170,7 +170,7 @@ typedef CURLcode Curl_cft_cntrl(struct Curl_cfilter *cf,
#define CF_QUERY_STREAM_ERROR 6 /* error code - */
#define CF_QUERY_NEED_FLUSH 7 /* TRUE/FALSE - */
#define CF_QUERY_IP_INFO 8 /* TRUE/FALSE struct ip_quadruple */
#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */
#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */
/* pass in a `const struct Curl_sockaddr_ex **` as `pres2`. Gets set
* to NULL when not connected. */
#define CF_QUERY_REMOTE_ADDR 10 /* - `Curl_sockaddr_ex *` */

View file

@ -284,7 +284,6 @@
/* ---------------------------------------------------------------- */
#ifndef CURL_WINDOWS_UWP
#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
#endif

View file

@ -61,7 +61,7 @@
#include "multiif.h"
#include "curlx/inet_ntop.h"
#include "curlx/strparse.h"
#include "vtls/vtls.h" /* for vtsl cfilters */
#include "vtls/vtls.h" /* for vtls cfilters */
#include "progress.h"
#include "conncache.h"
#include "multihandle.h"

View file

@ -115,8 +115,8 @@ int Curl_getaddrinfo_ex(const char *nodename,
for(ai = aihead; ai != NULL; ai = ai->ai_next) {
size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0;
/* ignore elements with unsupported address family, */
/* settle family-specific sockaddr structure size. */
/* ignore elements with unsupported address family,
settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
#ifdef USE_IPV6
@ -140,8 +140,8 @@ int Curl_getaddrinfo_ex(const char *nodename,
break;
}
/* copy each structure member individually, member ordering, */
/* size, or padding might be different for each platform. */
/* copy each structure member individually, member ordering,
size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;

View file

@ -725,13 +725,13 @@ ${SIZEOF_TIME_T_CODE}
automatically */
#cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1
/* to enable NGHTTP2 */
/* to enable NGHTTP2 */
#cmakedefine USE_NGHTTP2 1
/* to enable NGTCP2 */
#cmakedefine USE_NGTCP2 1
/* to enable NGHTTP3 */
/* to enable NGHTTP3 */
#cmakedefine USE_NGHTTP3 1
/* to enable quiche */
@ -743,13 +743,13 @@ ${SIZEOF_TIME_T_CODE}
/* Define to 1 if you have the quiche_conn_set_qlog_fd function. */
#cmakedefine HAVE_QUICHE_CONN_SET_QLOG_FD 1
/* if Unix domain sockets are enabled */
/* if Unix domain sockets are enabled */
#cmakedefine USE_UNIX_SOCKETS 1
/* to enable SSPI support */
#cmakedefine USE_WINDOWS_SSPI 1
/* to enable Windows SSL */
/* to enable Windows SSL */
#cmakedefine USE_SCHANNEL 1
/* if Watt-32 is in use */

View file

@ -28,10 +28,10 @@
#define MERR_MEM 1
#define MERR_TOO_LARGE 2
/* Lower-case digits. */
/* Lower-case digits. */
extern const unsigned char Curl_ldigits[];
/* Upper-case digits. */
/* Upper-case digits. */
extern const unsigned char Curl_udigits[];
#endif /* HEADER_CURL_PRINTF_H */

View file

@ -147,11 +147,11 @@ void Curl_sasl_init(struct SASL *sasl, struct Curl_easy *data,
/* Check if we have enough auth data and capabilities to authenticate */
bool Curl_sasl_can_authenticate(struct SASL *sasl, struct Curl_easy *data);
/* Calculate the required login details for SASL authentication */
/* Calculate the required login details for SASL authentication */
CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data,
bool force_ir, saslprogress *progress);
/* Continue an SASL authentication */
/* Continue an SASL authentication */
CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data,
int code, saslprogress *progress);

View file

@ -194,7 +194,6 @@ timediff_t curlx_ptimediff_ms(const struct curltime *newer,
return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000);
}
timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older)
{
return curlx_ptimediff_ms(&newer, &older);

View file

@ -24,7 +24,7 @@
*
***************************************************************************/
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */
* allocated string or NULL if an error occurred. */
enum urlreject {
REJECT_NADA = 2,

View file

@ -67,8 +67,8 @@ static struct addrinfo *mk_getaddrinfo(const struct ares_addrinfo *aihead)
for(ai = aihead->nodes; ai != NULL; ai = ai->ai_next) {
size_t ss_size;
size_t namelen = name ? strlen(name) + 1 : 0;
/* ignore elements with unsupported address family, */
/* settle family-specific sockaddr structure size. */
/* ignore elements with unsupported address family,
settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
else if(ai->ai_family == AF_INET6)
@ -90,8 +90,8 @@ static struct addrinfo *mk_getaddrinfo(const struct ares_addrinfo *aihead)
return NULL;
}
/* copy each structure member individually, member ordering, */
/* size, or padding might be different for each platform. */
/* copy each structure member individually, member ordering,
size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;

View file

@ -637,7 +637,7 @@ static CURLcode getftpresponse(struct Curl_easy *data,
* the OpenSSL read() does not grok that properly.
*
* Alas, read as much as possible, split up into lines, use the ending
* line in a response or continue reading. */
* line in a response or continue reading. */
struct connectdata *conn = data->conn;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
@ -1801,7 +1801,7 @@ static CURLcode ftp_state_retr(struct Curl_easy *data,
}
else {
/* We got a file size report, so we check that there actually is a
part of the file left to get, or else we go home. */
part of the file left to get, or else we go home. */
if(data->state.resume_from < 0) {
/* We are supposed to download the last abs(from) bytes */
if(filesize < -data->state.resume_from) {

View file

@ -684,11 +684,12 @@ static CURLcode output_auth_headers(struct Curl_easy *data,
/* Basic */
if(
#ifndef CURL_DISABLE_PROXY
(proxy && conn->bits.proxy_user_passwd &&
!Curl_checkProxyheaders(data, conn, STRCONST("Proxy-authorization"))) ||
(proxy && conn->bits.proxy_user_passwd &&
!Curl_checkProxyheaders(data, conn,
STRCONST("Proxy-authorization"))) ||
#endif
(!proxy && data->state.aptr.user &&
!Curl_checkheaders(data, STRCONST("Authorization")))) {
(!proxy && data->state.aptr.user &&
!Curl_checkheaders(data, STRCONST("Authorization")))) {
auth = "Basic";
result = http_output_basic(data, proxy);
if(result)
@ -703,8 +704,8 @@ static CURLcode output_auth_headers(struct Curl_easy *data,
#ifndef CURL_DISABLE_BEARER_AUTH
if(authstatus->picked == CURLAUTH_BEARER) {
/* Bearer */
if((!proxy && data->set.str[STRING_BEARER] &&
!Curl_checkheaders(data, STRCONST("Authorization")))) {
if(!proxy && data->set.str[STRING_BEARER] &&
!Curl_checkheaders(data, STRCONST("Authorization"))) {
auth = "Bearer";
result = http_output_bearer(data);
if(result)
@ -2625,7 +2626,6 @@ static CURLcode http_range(struct Curl_easy *data,
data->state.aptr.rangeline =
curl_maprintf("Content-Range: bytes 0-%" FMT_OFF_T "/"
"%" FMT_OFF_T "\r\n", req_clen - 1, req_clen);
}
else if(data->state.resume_from) {
/* This is because "resume" was selected */
@ -3776,7 +3776,7 @@ static CURLcode http_statusline(struct Curl_easy *data,
/* (quote from RFC2616, section 10.3.5): The 304 response
* MUST NOT contain a message-body, and thus is always
* terminated by the first empty line after the header
* fields. */
* fields. */
if(data->set.timecondition)
data->info.timecond = TRUE;
FALLTHROUGH();
@ -4345,7 +4345,7 @@ void Curl_http_to_fold(struct dynbuf *bf)
len--;
if(len && (hd[len - 1] == '\r'))
len--;
while(len && (ISBLANK(hd[len - 1]))) /* strip off trailing whitespace */
while(len && ISBLANK(hd[len - 1])) /* strip off trailing whitespace */
len--;
curlx_dyn_setlen(bf, len);
}

View file

@ -65,7 +65,7 @@
#define H2_NW_RECV_CHUNKS (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
/* on send into TLS, we just want to accumulate small frames */
#define H2_NW_SEND_CHUNKS 1
/* this is how much we want "in flight" for a stream, unthrottled */
/* this is how much we want "in flight" for a stream, unthrottled */
#define H2_STREAM_WINDOW_SIZE_MAX (10 * 1024 * 1024)
/* this is how much we want "in flight" for a stream, initially, IFF
* nghttp2 allows us to tweak the local window size. */
@ -888,7 +888,6 @@ static void h2_xfer_write_resp_hd(struct Curl_cfilter *cf,
struct h2_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
/* If we already encountered an error, skip further writes */
if(!stream->xfer_result) {
stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos);
@ -905,7 +904,6 @@ static void h2_xfer_write_resp(struct Curl_cfilter *cf,
struct h2_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
/* If we already encountered an error, skip further writes */
if(!stream->xfer_result)
stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos);

View file

@ -645,7 +645,6 @@ fail:
static int compare_func(const void *a, const void *b)
{
const struct pair *aa = a;
const struct pair *bb = b;
const size_t aa_key_len = curlx_dyn_len(&aa->key);

View file

@ -1176,7 +1176,7 @@ static CURLcode imap_state_login_resp(struct Curl_easy *data,
return result;
}
/* Detect IMAP listings vs. downloading a single email */
/* Detect IMAP listings vs. downloading a single email */
static bool is_custom_fetch_listing_match(const char *params)
{
/* match " 1:* (FLAGS ..." or " 1,2,3 (FLAGS ..." */
@ -2324,7 +2324,6 @@ static const struct Curl_protocol Curl_protocol_imap = {
#endif /* CURL_DISABLE_IMAP */
/*
* IMAP protocol handler.
*/

View file

@ -32,10 +32,10 @@
#define MAX_PARAMETERS 128 /* number of input arguments */
#define MAX_SEGMENTS 128 /* number of output segments */
/* Lower-case digits. */
/* Lower-case digits. */
const unsigned char Curl_ldigits[] = "0123456789abcdef";
/* Upper-case digits. */
/* Upper-case digits. */
const unsigned char Curl_udigits[] = "0123456789ABCDEF";
#define OUTCHAR(x) \
@ -131,9 +131,9 @@ struct asprintf {
};
/* the provided input number is 1-based but this returns the number 0-based.
returns -1 if no valid number was provided.
*/
*
* returns -1 if no valid number was provided.
*/
static int dollarstring(const char *p, const char **end)
{
curl_off_t num;
@ -596,8 +596,8 @@ static int parsefmt(const char *format,
}
struct mproperty {
int width; /* Width of a field. */
int prec; /* Precision of a field. */
int width; /* Width of a field. */
int prec; /* Precision of a field. */
unsigned int flags;
};
@ -722,7 +722,7 @@ static bool out_number(void *userp,
char *w;
if(flags & FLAGS_CHAR) {
/* Character. */
/* Character. */
if(!(flags & FLAGS_LEFT))
while(--width > 0)
OUTCHAR(' ');
@ -746,11 +746,11 @@ static bool out_number(void *userp,
;
else {
/* Decimal integer. */
/* Decimal integer. */
is_neg = (nums < 0);
if(is_neg) {
/* signed_num might fail to hold absolute negative minimum by 1 */
int64_t signed_num; /* Used to convert negative in positive. */
int64_t signed_num; /* Used to convert negative in positive. */
signed_num = nums + (int64_t)1;
signed_num = -signed_num;
num = (uint64_t)signed_num;
@ -758,11 +758,11 @@ static bool out_number(void *userp,
}
}
/* Supply a default precision if none was given. */
/* Supply a default precision if none was given. */
if(prec == -1)
prec = 1;
/* Put the number in WORK. */
/* Put the number in WORK. */
w = workend;
DEBUGASSERT(base <= 16);
switch(base) {
@ -822,7 +822,7 @@ static bool out_number(void *userp,
while(width-- > 0)
OUTCHAR('0');
/* Write the number. */
/* Write the number. */
while(++w <= workend) {
OUTCHAR(*w);
}
@ -848,7 +848,7 @@ static bool out_string(void *userp,
size_t len;
if(!str) {
/* Write null string if there is space. */
/* Write null string if there is space. */
if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) {
str = nilstr;
len = sizeof(nilstr) - 1;
@ -895,17 +895,17 @@ static bool out_pointer(void *userp,
char *work,
int *donep)
{
/* Generic pointer. */
/* Generic pointer. */
if(ptr) {
size_t num = (size_t)ptr;
/* If the pointer is not NULL, write it as a %#x spec. */
/* If the pointer is not NULL, write it as a %#x spec. */
p->flags |= FLAGS_HEX | FLAGS_ALT;
if(out_number(userp, stream, p, num, 0, work, donep))
return TRUE;
}
else {
/* Write "(nil)" for a nil pointer. */
/* Write "(nil)" for a nil pointer. */
const char *point;
int width = p->width;
int flags = p->flags;
@ -946,7 +946,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the
const char *format, /* %-formatted string */
va_list ap_save) /* list of parameters */
{
int done = 0; /* number of characters written */
int done = 0; /* number of characters written */
int i;
int ocount = 0; /* number of output segments */
int icount = 0; /* number of input arguments */
@ -1042,7 +1042,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the
break;
case MTYPE_INTPTR:
/* Answer the count of characters written. */
/* Answer the count of characters written. */
if(p.flags & FLAGS_LONGLONG)
*(int64_t *)iptr->val.ptr = (int64_t)done;
else

View file

@ -962,7 +962,6 @@ static CURLcode mqtts_connecting(struct Curl_easy *data, bool *done)
/*
* MQTTS protocol.
*/
static const struct Curl_protocol Curl_protocol_mqtts = {
mqtt_setup_conn, /* setup_connection */
mqtt_do, /* do_it */
@ -988,7 +987,6 @@ static const struct Curl_protocol Curl_protocol_mqtts = {
/*
* MQTT protocol.
*/
static const struct Curl_protocol Curl_protocol_mqtt = {
mqtt_setup_conn, /* setup_connection */
mqtt_do, /* do_it */
@ -1011,7 +1009,6 @@ static const struct Curl_protocol Curl_protocol_mqtt = {
#endif /* CURL_DISABLE_MQTT */
const struct Curl_scheme Curl_scheme_mqtts = {
"mqtts", /* scheme */
#if defined(CURL_DISABLE_MQTT) || !defined(USE_SSL)
@ -1028,7 +1025,6 @@ const struct Curl_scheme Curl_scheme_mqtts = {
/*
* MQTT protocol.
*/
const struct Curl_scheme Curl_scheme_mqtt = {
"mqtt", /* scheme */
#ifdef CURL_DISABLE_MQTT

View file

@ -151,7 +151,7 @@ static NETRCcode parsenetrc(struct store_netrc *store,
}
if(!*tok || (*tok == '\n'))
/* end of line */
/* end of line */
break;
/* leading double-quote means quoted string */

View file

@ -114,7 +114,6 @@ struct ldapreqinfo {
/* meta key for storing ldapconninfo at connection */
#define CURL_META_LDAP_CONN "meta:proto:ldap:conn"
/*
* oldap_state()
*

View file

@ -169,14 +169,11 @@ CURLcode Curl_pollset_set(struct Curl_easy *data,
#define Curl_pollset_remove_out(data, ps, sock) \
Curl_pollset_change(data, ps, sock, 0, CURL_POLL_OUT)
#define Curl_pollset_add_inout(data, ps, sock) \
Curl_pollset_change(data, ps, sock, \
CURL_POLL_IN | CURL_POLL_OUT, 0)
Curl_pollset_change(data, ps, sock, CURL_POLL_IN | CURL_POLL_OUT, 0)
#define Curl_pollset_set_in_only(data, ps, sock) \
Curl_pollset_change(data, ps, sock, \
CURL_POLL_IN, CURL_POLL_OUT)
Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
#define Curl_pollset_set_out_only(data, ps, sock) \
Curl_pollset_change(data, ps, sock, \
CURL_POLL_OUT, CURL_POLL_IN)
Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
/* return < = on error, 0 on timeout or how many sockets are ready */
int Curl_pollset_poll(struct Curl_easy *data,

View file

@ -55,7 +55,7 @@ struct Curl_cwriter;
struct Curl_easy;
/**
* Write `len` bytes at `prt` to the client. `type` indicates what
* Write `len` bytes at `buf` to the client. `type` indicates what
* kind of data is being written.
*/
CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf,

View file

@ -24,11 +24,10 @@
*
***************************************************************************/
/* */
/* JEM, 12/30/12, VMS now generates config.h, so only define wrappers for */
/* getenv(), getpwuid() and provide is_vms_shell() */
/* Also need upper case symbols for system services, and */
/* OpenSSL, and some Kerberos image */
/* JEM, 2012-12-30, VMS now generates config.h, so only define wrappers for */
/* getenv(), getpwuid() and provide is_vms_shell() */
/* Also need upper case symbols for system services, and */
/* OpenSSL, and some Kerberos image */
#ifdef __DECC
#pragma message save

View file

@ -232,8 +232,8 @@ static void my_sha256_final(unsigned char *digest, void *in)
(a)[3] = (unsigned char) (((unsigned long)(val)) & 0xff); \
} while(0)
#define WPA_PUT_BE64(a, val) \
do { \
#define WPA_PUT_BE64(a, val) \
do { \
(a)[0] = (unsigned char)(((uint64_t)(val)) >> 56); \
(a)[1] = (unsigned char)(((uint64_t)(val)) >> 48); \
(a)[2] = (unsigned char)(((uint64_t)(val)) >> 40); \

View file

@ -1249,7 +1249,7 @@ const struct Curl_scheme Curl_scheme_smb = {
*/
const struct Curl_scheme Curl_scheme_smbs = {
"smbs", /* scheme */
#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \
#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \
!defined(USE_SSL)
ZERO_NULL,
#else

View file

@ -1061,9 +1061,9 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data,
"MAIL FROM:%s%s%s%s%s%s",
from, /* Mandatory */
auth ? " AUTH=" : "", /* Optional on AUTH support */
auth ? auth : "", /* */
auth ? auth : "",
size ? " SIZE=" : "", /* Optional on SIZE support */
size ? size : "", /* */
size ? size : "",
utf8 ? " SMTPUTF8" /* Internationalised mailbox */
: ""); /* included in our envelope */

View file

@ -1339,7 +1339,6 @@ static CURLcode socks_cf_adjust_pollset(struct Curl_cfilter *cf,
static void socks_proxy_cf_close(struct Curl_cfilter *cf,
struct Curl_easy *data)
{
DEBUGASSERT(cf->next);
cf->connected = FALSE;
socks_proxy_cf_free(cf);

View file

@ -281,7 +281,7 @@ static CURLcode socks5_sspi_encrypt(struct Curl_cfilter *cf,
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
(gss_enc == 0) ? "no" :
((gss_enc == 1) ? "integrity" : "confidentiality") );
((gss_enc == 1) ? "integrity" : "confidentiality"));
sspi_w_token[0].pvBuffer =
sspi_w_token[1].pvBuffer =

View file

@ -45,7 +45,7 @@ CURLcode Curl_win32_init(long flags)
if(res)
/* Tell the user that we could not find a usable */
/* winsock.dll. */
/* winsock.dll. */
return CURLE_FAILED_INIT;
/* Confirm that the Windows Sockets DLL supports what we need.*/

View file

@ -1844,7 +1844,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
#ifdef USE_IPV6
if(data->set.scope_id)
/* Override any scope that was set above. */
/* Override any scope that was set above. */
conn->scope_id = data->set.scope_id;
#endif
@ -2538,7 +2538,6 @@ error:
static CURLcode parse_remote_port(struct Curl_easy *data,
struct connectdata *conn)
{
if(data->set.use_port && data->state.allow_port) {
/* if set, we use this instead of the port possibly given in the URL */
char portbuf[16];

View file

@ -217,7 +217,7 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */
* us early warning on things only discovered by valgrind otherwise. */
#define GOOD_EASY_HANDLE(x) \
(((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
(DEBUGASSERT(!(x)), FALSE))
(DEBUGASSERT(!(x)), FALSE))
#else
#define GOOD_EASY_HANDLE(x) \
((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER))
@ -1303,7 +1303,7 @@ struct UserDefined {
curl_write_callback fwrite_header; /* function that stores headers */
curl_write_callback fwrite_rtp; /* function that stores interleaved RTP */
curl_read_callback fread_func_set; /* function that reads the input */
curl_progress_callback fprogress; /* OLD and deprecated progress callback */
curl_progress_callback fprogress; /* OLD and deprecated progress callback */
curl_xferinfo_callback fxferinfo; /* progress callback */
curl_debug_callback fdebug; /* function that write informational data */
curl_ioctl_callback ioctl_func; /* function for I/O control */
@ -1373,7 +1373,7 @@ struct UserDefined {
curl_off_t max_filesize; /* Maximum file size to download */
#ifndef CURL_DISABLE_FTP
timediff_t accepttimeout; /* in milliseconds, 0 means no timeout */
uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */
uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */
uint8_t ftpsslauth; /* what AUTH XXX to try: curl_ftpauth */
uint8_t ftp_ccc; /* FTP CCC options: curl_ftpccc */
#endif
@ -1443,7 +1443,7 @@ struct UserDefined {
#endif
uint32_t maxconnects; /* Max idle connections in the connection cache */
#ifdef USE_ECH
int tls_ech; /* TLS ECH configuration */
int tls_ech; /* TLS ECH configuration */
#endif
short maxredirs; /* maximum no. of http(s) redirects to follow,
set to -1 for infinity */
@ -1460,7 +1460,7 @@ struct UserDefined {
uint16_t tftp_blksize; /* in bytes, 0 means use default */
#endif
#ifndef CURL_DISABLE_NETRC
uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */
uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */
#endif
#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
/* Despite the name, ftp_create_missing_dirs is for FTP(S) and SFTP
@ -1543,7 +1543,7 @@ struct UserDefined {
BIT(opt_no_body); /* as set with CURLOPT_NOBODY */
BIT(verbose); /* output verbosity */
BIT(reuse_forbid); /* forbidden to be reused, close after use */
BIT(reuse_fresh); /* do not reuse an existing connection */
BIT(reuse_fresh); /* do not reuse an existing connection */
BIT(no_signal); /* do not use any signal/alarm handler */
BIT(tcp_nodelay); /* whether to enable TCP_NODELAY or not */
BIT(ignorecl); /* ignore content length */

View file

@ -1227,7 +1227,7 @@ static int myssh_in_SFTP_CLOSE(struct Curl_easy *data,
/* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT
After nextstate is executed, the control should come back to
SSH_SFTP_CLOSE to pass the correct result back */
SSH_SFTP_CLOSE to pass the correct result back */
if(sshc->nextstate != SSH_NO_STATE &&
sshc->nextstate != SSH_SFTP_CLOSE) {
myssh_to(data, sshc, sshc->nextstate);

View file

@ -2297,7 +2297,7 @@ static CURLcode ssh_state_sftp_close(struct Curl_easy *data,
/* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT
After nextstate is executed, the control should come back to
SSH_SFTP_CLOSE to pass the correct result back */
SSH_SFTP_CLOSE to pass the correct result back */
if(sshc->nextstate != SSH_NO_STATE &&
sshc->nextstate != SSH_SFTP_CLOSE) {
myssh_to(data, sshc, sshc->nextstate);

View file

@ -5384,7 +5384,7 @@ static CURLcode ossl_random(struct Curl_easy *data,
if(!rand_enough())
return CURLE_FAILED_INIT;
}
/* RAND_bytes() returns 1 on success, 0 otherwise. */
/* RAND_bytes() returns 1 on success, 0 otherwise. */
rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
}

View file

@ -416,7 +416,7 @@ static CURLcode get_client_cert(struct Curl_easy *data,
}
if(fInCert || blob) {
/* Reading a .P12 or .pfx file, like the example at bottom of
/* Reading a .p12 or .pfx file, like the example at bottom of
https://learn.microsoft.com/archive/msdn-technet-forums/3e7bc95f-b21a-4bcd-bd2c-7f996718cae5
*/
CRYPT_DATA_BLOB datablob;
@ -2030,8 +2030,8 @@ static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data,
timediff_t timeout_ms = Curl_timeleft_ms(data);
if(timeout_ms < 0) {
/* we already got the timeout */
failf(data, "schannel: timed out sending data "
"(bytes sent: %zu)", *pnwritten);
failf(data, "schannel: timed out sending data (bytes sent: %zu)",
*pnwritten);
result = CURLE_OPERATION_TIMEDOUT;
break;
}
@ -2045,8 +2045,8 @@ static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data,
break;
}
else if(what == 0) {
failf(data, "schannel: timed out sending data "
"(bytes sent: %zu)", *pnwritten);
failf(data, "schannel: timed out sending data (bytes sent: %zu)",
*pnwritten);
result = CURLE_OPERATION_TIMEDOUT;
break;
}

View file

@ -38,20 +38,20 @@
#include "vtls/schannel.h"
#include "vtls/schannel_int.h"
#include "curlx/fopen.h"
#include "curlx/inet_pton.h"
#include "vtls/hostcheck.h"
#include "vtls/vtls.h"
#include "vtls/vtls_int.h"
#include "curl_trc.h"
#include "strerror.h"
#include "curlx/winapi.h"
#include "curlx/fopen.h"
#include "curlx/inet_pton.h"
#include "curlx/multibyte.h"
#include "vtls/hostcheck.h"
#include "curlx/version_win32.h"
#include "curlx/winapi.h"
#define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend)
#define MAX_CAFILE_SIZE 1048576 /* 1 MiB */
#define MAX_CAFILE_SIZE (1024 * 1024) /* 1 MiB */
#define BEGIN_CERT "-----BEGIN CERTIFICATE-----"
#define END_CERT "\n-----END CERTIFICATE-----"
@ -438,10 +438,8 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname)
{
struct in_addr ia;
struct in6_addr ia6;
bool result = FALSE;
struct in_addr ia;
int res = curlx_inet_pton(AF_INET, hostname, &ia);
if(res) {
ip_blob->size = sizeof(struct in_addr);
@ -449,6 +447,7 @@ static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname)
result = TRUE;
}
else {
struct in6_addr ia6;
res = curlx_inet_pton(AF_INET6, hostname, &ia6);
if(res) {
ip_blob->size = sizeof(struct in6_addr);

View file

@ -97,7 +97,7 @@ struct ssl_peer {
CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name,
const curl_ssl_backend ***avail);
#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1 MiB */
#define MAX_PINNED_PUBKEY_SIZE (1024 * 1024) /* 1 MiB */
curl_sslbackend Curl_ssl_backend(void);

View file

@ -1424,7 +1424,6 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx,
result = CURLE_SSL_CONNECT_ERROR;
goto out;
}
}
#endif /* HAVE_WOLFSSL_CTX_GENERATEECHCONFIG */