From 308c347c8b5d36e6eefeff7fbf5e419a5f621e5a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 12 Dec 2025 20:51:52 +0100 Subject: [PATCH] tidy-up: miscellaneous - apply more clang-format. - lib/version: use `CURL_ARRAYSIZE()`. - INSTALL-CMAKE.md: sync-up an option description with others. - examples: delete unused main args. - examples/ftpgetinfo: document `_CRT_SECURE_NO_WARNINGS` symbol. - delete remaining stray duplicate lines. - acinclude.m4: drop an unnecessary x-hack. - vtls/mbedtls: join a URL split into two lines. - src/tool_cb_see: add parentheses around macro expressions. - src/tool_operate: move literals to the right side of comparisons. - libtests: sync up fopen/fstat error messages between tests. - curl_setup.h: replace `if ! defined __LP64` with `ifndef __LP64`. I assume it makes no difference on Tandem systems, as the latter form is already used in `include/curl/system.h`. Closes #20018 --- acinclude.m4 | 2 +- docs/INSTALL-CMAKE.md | 2 +- docs/examples/ephiperfifo.c | 4 +- docs/examples/evhiperfifo.c | 4 +- docs/examples/ftpgetinfo.c | 2 +- docs/examples/hiperfifo.c | 4 +- lib/conncache.c | 2 - lib/content_encoding.c | 4 +- lib/curl_setup.h | 87 +- lib/curl_setup_once.h | 4 +- lib/easy.c | 1 - lib/easy_lock.h | 2 +- lib/ftp.c | 1 - lib/imap.c | 1 - lib/mime.c | 2 - lib/rtsp.c | 2 - lib/smtp.c | 1 - lib/telnet.c | 1 - lib/tftp.c | 2 - lib/urldata.h | 14 +- lib/version.c | 4 +- lib/vquic/vquic.c | 1 - lib/vssh/libssh.c | 1 - lib/vssh/libssh2.c | 2 - lib/vtls/mbedtls.c | 6 +- lib/vtls/openssl.c | 5 +- lib/vtls/schannel.c | 4 +- lib/vtls/wolfssl.c | 1 - lib/vtls/x509asn1.c | 1 - lib/ws.c | 2 - m4/curl-reentrant.m4 | 1 + scripts/managen | 4 +- src/tool_cb_prg.c | 3 +- src/tool_cb_prg.h | 3 +- src/tool_cb_see.c | 4 +- src/tool_cfgable.h | 2 +- src/tool_filetime.c | 6 +- src/tool_formparse.c | 6 +- src/tool_libinfo.c | 68 +- src/tool_listhelp.c | 1652 +++++++++++++++++------------------ src/tool_msgs.c | 9 +- src/tool_operate.c | 14 +- src/tool_paramhlp.c | 16 +- src/tool_setup.h | 2 +- src/tool_writeout_json.c | 3 +- src/tool_writeout_json.h | 3 +- tests/libtest/lib505.c | 2 +- tests/libtest/lib525.c | 2 +- tests/libtest/lib541.c | 2 +- tests/libtest/lib568.c | 9 +- tests/libtest/lib572.c | 9 +- tests/test1139.pl | 2 +- tests/unit/unit1664.c | 2 + 53 files changed, 988 insertions(+), 1005 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index f38eac8211..775102033c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1168,7 +1168,7 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), dnl --with-ca-path given capath="$want_capath" ca="no" - elif test "x$ca_native" != "xno"; then + elif test "$ca_native" != "no"; then # native ca configured, do not look further ca="no" capath="no" diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index a3598c790a..03b9676145 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -389,7 +389,7 @@ Details via CMake - `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries. - `ZLIB_INCLUDE_DIR`: Absolute path to zlib include directory. - `ZLIB_LIBRARY`: Absolute path to `zlib` library. -- `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24). +- `ZLIB_USE_STATIC_LIBS`: Look for static `zlib` library (requires CMake v3.24). ## Dependency options (tools) diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index a2cd0f2e7e..f5b5913747 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -451,15 +451,13 @@ void sigint_handler(int signo) g_should_exit_ = 1; } -int main(int argc, char **argv) +int main(void) { CURLcode result; struct GlobalInfo g; struct itimerspec its; struct epoll_event ev; struct epoll_event events[10]; - (void)argc; - (void)argv; result = curl_global_init(CURL_GLOBAL_ALL); if(result) diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 776ab06a88..aecbfe8f15 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -410,12 +410,10 @@ static int init_fifo(struct GlobalInfo *g) return 0; } -int main(int argc, char **argv) +int main(void) { CURLcode result; struct GlobalInfo g; - (void)argc; - (void)argv; result = curl_global_init(CURL_GLOBAL_ALL); if(result) diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c index 7d3181b9f3..82861c21a8 100644 --- a/docs/examples/ftpgetinfo.c +++ b/docs/examples/ftpgetinfo.c @@ -27,7 +27,7 @@ */ #ifdef _MSC_VER #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#define _CRT_SECURE_NO_WARNINGS /* for ctime(), fopen() */ #endif #endif diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 4bdba3607a..fc4c180582 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -419,12 +419,10 @@ static void clean_fifo(struct GlobalInfo *g) unlink(fifo); } -int main(int argc, char **argv) +int main(void) { CURLcode result; struct GlobalInfo g; - (void)argc; - (void)argv; result = curl_global_init(CURL_GLOBAL_ALL); if(result) diff --git a/lib/conncache.c b/lib/conncache.c index 458d85d110..d9efb61a07 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -69,7 +69,6 @@ } \ } while(0) - /* A list of connections to the same destination. */ struct cpool_bundle { struct Curl_llist conns; /* connections in the bundle */ @@ -167,7 +166,6 @@ static struct cpool_bundle *cpool_find_bundle(struct cpool *cpool, conn->destination, strlen(conn->destination) + 1); } - static void cpool_remove_bundle(struct cpool *cpool, struct cpool_bundle *bundle) { diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 47adac0f43..f0e527e8c4 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -287,8 +287,10 @@ static const struct Curl_cwtype deflate_encoding = { sizeof(struct zlib_writer) }; +/* + * Gzip handler. + */ -/* Gzip handler. */ static CURLcode gzip_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 7ba32f069f..d487bfdff9 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -162,7 +162,7 @@ /* ================================================================ */ /* Definition of preprocessor macros/symbols which modify compiler */ -/* behavior or generated code characteristics must be done here, */ +/* behavior or generated code characteristics must be done here, */ /* as appropriate, before any system header file is included. It is */ /* also possible to have them defined in the config file included */ /* before this point. As a result of all this we frown inclusion of */ @@ -449,7 +449,7 @@ #include #ifdef __TANDEM /* for ns*-tandem-nsk systems */ -# if ! defined __LP64 +# ifndef __LP64 # include /* FLOSS is only used for 32-bit builds. */ # endif #endif @@ -783,7 +783,7 @@ * Definition of our NOP statement Object-like macro */ #ifndef Curl_nop_stmt -#define Curl_nop_stmt do { } while(0) +#define Curl_nop_stmt do {} while(0) #endif /* @@ -843,8 +843,8 @@ Therefore we specify it explicitly. https://github.com/curl/curl/pull/258 */ #if defined(_WIN32) || defined(MSDOS) -#define FOPEN_READTEXT "rt" -#define FOPEN_WRITETEXT "wt" +#define FOPEN_READTEXT "rt" +#define FOPEN_WRITETEXT "wt" #define FOPEN_APPENDTEXT "at" #elif defined(__CYGWIN__) /* Cygwin has specific behavior we need to address when _WIN32 is not defined. @@ -853,12 +853,12 @@ For write we want our output to have line endings of LF and be compatible with other Cygwin utilities. For read we want to handle input that may have line endings either CRLF or LF so 't' is appropriate. */ -#define FOPEN_READTEXT "rt" -#define FOPEN_WRITETEXT "w" +#define FOPEN_READTEXT "rt" +#define FOPEN_WRITETEXT "w" #define FOPEN_APPENDTEXT "a" #else -#define FOPEN_READTEXT "r" -#define FOPEN_WRITETEXT "w" +#define FOPEN_READTEXT "r" +#define FOPEN_WRITETEXT "w" #define FOPEN_APPENDTEXT "a" #endif @@ -919,7 +919,10 @@ extern curl_calloc_callback Curl_ccalloc; * This macro also assigns NULL to given pointer when free'd. */ #define Curl_safefree(ptr) \ - do { curlx_free(ptr); (ptr) = NULL;} while(0) + do { \ + curlx_free(ptr); \ + (ptr) = NULL; \ + } while(0) #include /* for CURL_EXTERN, mprintf.h */ @@ -1002,15 +1005,13 @@ CURL_EXTERN RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd, /* FILE functions */ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); -CURL_EXTERN ALLOC_FUNC - FILE *curl_dbg_fopen(const char *file, const char *mode, - int line, const char *source); -CURL_EXTERN ALLOC_FUNC - FILE *curl_dbg_freopen(const char *file, const char *mode, FILE *fh, - int line, const char *source); -CURL_EXTERN ALLOC_FUNC - FILE *curl_dbg_fdopen(int filedes, const char *mode, - int line, const char *source); +CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fopen(const char *file, const char *mode, + int line, const char *source); +CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_freopen(const char *file, + const char *mode, FILE *fh, + int line, const char *source); +CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode, + int line, const char *source); #define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__) #define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd, __LINE__, __FILE__) @@ -1059,47 +1060,47 @@ CURL_EXTERN ALLOC_FUNC #ifdef CURLDEBUG -#define curlx_strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) -#define curlx_malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__) -#define curlx_calloc(nbelem,size) \ - curl_dbg_calloc(nbelem, size, __LINE__, __FILE__) -#define curlx_realloc(ptr,size) \ - curl_dbg_realloc(ptr, size, __LINE__, __FILE__) -#define curlx_free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__) +#define curlx_strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) +#define curlx_malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__) +#define curlx_calloc(nbelem, size) \ + curl_dbg_calloc(nbelem, size, __LINE__, __FILE__) +#define curlx_realloc(ptr, size) \ + curl_dbg_realloc(ptr, size, __LINE__, __FILE__) +#define curlx_free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__) #ifdef _WIN32 #ifdef UNICODE -#define curlx_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) +#define curlx_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) #else -#define curlx_tcsdup(ptr) curlx_strdup(ptr) +#define curlx_tcsdup(ptr) curlx_strdup(ptr) #endif #endif /* _WIN32 */ #else /* !CURLDEBUG */ #ifdef BUILDING_LIBCURL -#define curlx_strdup(ptr) Curl_cstrdup(ptr) -#define curlx_malloc(size) Curl_cmalloc(size) -#define curlx_calloc(nbelem,size) Curl_ccalloc(nbelem, size) -#define curlx_realloc(ptr,size) Curl_crealloc(ptr, size) -#define curlx_free(ptr) Curl_cfree(ptr) +#define curlx_strdup(ptr) Curl_cstrdup(ptr) +#define curlx_malloc(size) Curl_cmalloc(size) +#define curlx_calloc(nbelem, size) Curl_ccalloc(nbelem, size) +#define curlx_realloc(ptr, size) Curl_crealloc(ptr, size) +#define curlx_free(ptr) Curl_cfree(ptr) #else /* !BUILDING_LIBCURL */ #ifdef _WIN32 -#define curlx_strdup(ptr) _strdup(ptr) +#define curlx_strdup(ptr) _strdup(ptr) #else -#define curlx_strdup(ptr) strdup(ptr) +#define curlx_strdup(ptr) strdup(ptr) #endif -#define curlx_malloc(size) malloc(size) -#define curlx_calloc(nbelem,size) calloc(nbelem, size) -#define curlx_realloc(ptr,size) realloc(ptr, size) -#define curlx_free(ptr) free(ptr) +#define curlx_malloc(size) malloc(size) +#define curlx_calloc(nbelem, size) calloc(nbelem, size) +#define curlx_realloc(ptr, size) realloc(ptr, size) +#define curlx_free(ptr) free(ptr) #endif /* BUILDING_LIBCURL */ #ifdef _WIN32 #ifdef UNICODE -#define curlx_tcsdup(ptr) Curl_wcsdup(ptr) +#define curlx_tcsdup(ptr) Curl_wcsdup(ptr) #else -#define curlx_tcsdup(ptr) curlx_strdup(ptr) +#define curlx_tcsdup(ptr) curlx_strdup(ptr) #endif #endif /* _WIN32 */ @@ -1124,8 +1125,8 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, #endif #if (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || \ - (defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3)) || \ - defined(USE_QUICHE) + (defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3)) || \ + defined(USE_QUICHE) #ifdef CURL_WITH_MULTI_SSL #error "MultiSSL combined with QUIC is not supported" diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 742d000b85..898b9a61ad 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -263,7 +263,7 @@ typedef unsigned int bit; #ifdef DEBUGBUILD #define DEBUGF(x) x #else -#define DEBUGF(x) do { } while(0) +#define DEBUGF(x) do {} while(0) #endif /* @@ -273,7 +273,7 @@ typedef unsigned int bit; #ifdef DEBUGBUILD #define DEBUGASSERT(x) assert(x) #else -#define DEBUGASSERT(x) do { } while(0) +#define DEBUGASSERT(x) do {} while(0) #endif /* diff --git a/lib/easy.c b/lib/easy.c index 3dd28d55c7..d7d766a4f8 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -643,7 +643,6 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) } } - if(!ev->msbump && ev->ms >= 0) { /* If nothing updated the timeout, we decrease it by the spent time. * If it was updated, it has the new timeout time stored already. diff --git a/lib/easy_lock.h b/lib/easy_lock.h index a10fe3103a..927b11d70f 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -59,7 +59,7 @@ #endif #endif -#endif +#endif /* !__INTEL_COMPILER */ static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock) { diff --git a/lib/ftp.c b/lib/ftp.c index f35743017a..00f3385440 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3685,7 +3685,6 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) return result; } - /*********************************************************************** * * ftp_perform() diff --git a/lib/imap.c b/lib/imap.c index 5bb2474b33..8b8bd9ca03 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -142,7 +142,6 @@ struct IMAP { BIT(uidvalidity_set); }; - /* Local API functions */ static CURLcode imap_regular_transfer(struct Curl_easy *data, struct IMAP *imap, diff --git a/lib/mime.c b/lib/mime.c index 92edd78878..4f01086c12 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -262,7 +262,6 @@ static char *Curl_basename(char *path) #define basename(x) Curl_basename(x) #endif - /* Set readback state. */ static void mimesetstate(struct mime_state *state, enum mimestate tok, void *ptr) @@ -272,7 +271,6 @@ static void mimesetstate(struct mime_state *state, state->offset = 0; } - /* Escape header string into allocated memory. */ static char *escape_string(struct Curl_easy *data, const char *src, enum mimestrategy strategy) diff --git a/lib/rtsp.c b/lib/rtsp.c index 8cd756c4a7..d73ad31813 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -43,7 +43,6 @@ #include "bufref.h" #include "curlx/strparse.h" - /* meta key for storing protocol meta at easy handle */ #define CURL_META_RTSP_EASY "meta:proto:rtsp:easy" /* meta key for storing protocol meta at connection */ @@ -72,7 +71,6 @@ struct RTSP { long CSeq_recv; /* CSeq received */ }; - #define RTP_PKT_LENGTH(p) ((((unsigned int)((unsigned char)((p)[2]))) << 8) | \ ((unsigned int)((unsigned char)((p)[3])))) diff --git a/lib/smtp.c b/lib/smtp.c index f8cef899f3..8ae7bc169d 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1703,7 +1703,6 @@ static CURLcode smtp_regular_transfer(struct Curl_easy *data, return result; } - static void smtp_easy_dtor(void *key, size_t klen, void *entry) { struct SMTP *smtp = entry; diff --git a/lib/telnet.c b/lib/telnet.c index 843a6e5b00..4a25527388 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -94,7 +94,6 @@ #define CURL_EMPTY 0 #define CURL_OPPOSITE 1 - /* meta key for storing protocol meta at easy handle */ #define CURL_META_TELNET_EASY "meta:proto:telnet:easy" diff --git a/lib/tftp.c b/lib/tftp.c index c39222d9c3..19b368a684 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -143,7 +143,6 @@ struct tftp_conn { BIT(remote_pinned); }; - /* Forward declarations */ static CURLcode tftp_rx(struct tftp_conn *state, tftp_event_t event); static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event); @@ -162,7 +161,6 @@ static CURLcode tftp_translate_code(tftp_error_t error); /* * TFTP protocol handler. */ - const struct Curl_handler Curl_handler_tftp = { "tftp", /* scheme */ tftp_setup_connection, /* setup_connection */ diff --git a/lib/urldata.h b/lib/urldata.h index f3bdf37235..8ff5ad98b5 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -741,14 +741,14 @@ struct connectdata { #ifndef CURL_DISABLE_PROXY #define CURL_CONN_HOST_DISPNAME(c) \ - ((c)->bits.socksproxy ? (c)->socks_proxy.host.dispname : \ - (c)->bits.httpproxy ? (c)->http_proxy.host.dispname : \ - (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ - (c)->host.dispname) + ((c)->bits.socksproxy ? (c)->socks_proxy.host.dispname : \ + (c)->bits.httpproxy ? (c)->http_proxy.host.dispname : \ + (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ + (c)->host.dispname) #else #define CURL_CONN_HOST_DISPNAME(c) \ - (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ - (c)->host.dispname + (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ + (c)->host.dispname #endif /* The end of connectdata. */ @@ -1162,7 +1162,7 @@ enum dupstring { STRING_SSL_CIPHER_LIST, /* list of ciphers to use */ STRING_SSL_CIPHER13_LIST, /* list of TLS 1.3 ciphers to use */ STRING_SSL_CRLFILE, /* CRL file to check certificate */ - STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ + STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ STRING_SERVICE_NAME, /* Service name */ #ifndef CURL_DISABLE_PROXY STRING_CERT_PROXY, /* client certificate filename */ diff --git a/lib/version.c b/lib/version.c index fe4f637d67..246e7871db 100644 --- a/lib/version.c +++ b/lib/version.c @@ -551,9 +551,7 @@ static const struct feat features_table[] = { {NULL, NULL, 0} }; -static const char *feature_names[sizeof(features_table) / - sizeof(features_table[0])] = {NULL}; - +static const char *feature_names[CURL_ARRAYSIZE(features_table)] = { NULL }; static curl_version_info_data version_info = { CURLVERSION_NOW, diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index be35a96021..03da05dcce 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -54,7 +54,6 @@ #define NW_CHUNK_SIZE (64 * 1024) #define NW_SEND_CHUNKS 1 - int Curl_vquic_init(void) { #if defined(USE_NGTCP2) && defined(OPENSSL_QUIC_API2) diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index e03ad5a968..1108d70cb2 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -282,7 +282,6 @@ static const char *myssh_statename(sshstate state) #define myssh_statename(x) "" #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ - #define myssh_to(x, y, z) myssh_set_state(x, y, z) /* diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index ba2a9375d7..0f023078eb 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -123,7 +123,6 @@ const struct Curl_handler Curl_handler_scp = { PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; - /* * SFTP protocol handler. */ @@ -353,7 +352,6 @@ static const char *myssh_statename(sshstate state) #define myssh_statename(x) "" #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ - #define myssh_state(x, y, z) myssh_set_state(x, y, z) /* diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4841e69088..b299f684dc 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -229,9 +229,9 @@ static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = { 1024, /* RSA min key len */ }; -/* See https://web.archive.org/web/20200921194007/tls.mbed.org/discussions/ - generic/howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der -*/ +/* See: + * https://web.archive.org/web/20200921194007/tls.mbed.org/discussions/generic/howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der + */ #define RSA_PUB_DER_MAX_BYTES (38 + 2 * MBEDTLS_MPI_MAX_SIZE) #define ECP_PUB_DER_MAX_BYTES (30 + 2 * MBEDTLS_ECP_MAX_BYTES) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 7563d9a090..d09e2d1a71 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1443,7 +1443,6 @@ fail: return 1; } - static CURLcode client_cert(struct Curl_easy *data, SSL_CTX* ctx, char *cert_file, @@ -3629,7 +3628,6 @@ static CURLcode ossl_init_ssl(struct ossl_ctx *octx, alpns_requested, sess_reuse_cb); } - static CURLcode ossl_init_method(struct Curl_cfilter *cf, struct Curl_easy *data, struct ssl_peer *peer, @@ -3828,7 +3826,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, OpenSSL supports processing "jumbo TLS record" (8 TLS records) in one go for some algorithms, so match that here. Experimentation shows that a slightly larger buffer is needed - to avoid short reads. + to avoid short reads. However using a large buffer (8 packets) actually decreases performance. 4 packets is better. @@ -4669,7 +4667,6 @@ out: } #endif /* ! CURL_DISABLE_VERBOSE_STRINGS */ - #ifdef USE_APPLE_SECTRUST struct ossl_certs_ctx { STACK_OF(X509) *sk; diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 8a6550d8bf..2aa889bde2 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -70,8 +70,8 @@ #define SCH_DEV_SHOWBOOL(x) \ infof(data, "schannel: " #x " %s", (x) ? "TRUE" : "FALSE"); #else -#define SCH_DEV(x) do { } while(0) -#define SCH_DEV_SHOWBOOL(x) do { } while(0) +#define SCH_DEV(x) do {} while(0) +#define SCH_DEV_SHOWBOOL(x) do {} while(0) #endif /* Offered by mingw-w64 v8+. MS SDK 7.0A+. */ diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index cf3774b5e8..3632d962ef 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -36,7 +36,6 @@ #include #include - #if LIBWOLFSSL_VERSION_HEX < 0x03004006 /* wolfSSL 3.4.6 (2015) */ #error "wolfSSL version should be at least 3.4.6" #endif diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index 4f3c6ca170..e06499751c 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -92,7 +92,6 @@ /* #define CURL_ASN1_CHARACTER_STRING 29 */ #define CURL_ASN1_BMP_STRING 30 - #ifdef WANT_EXTRACT_CERTINFO /* ASN.1 OID table entry. */ struct Curl_OID { diff --git a/lib/ws.c b/lib/ws.c index bde13419e6..aea3bac98c 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -43,7 +43,6 @@ #include "curlx/strparse.h" #include "curlx/warnless.h" - /*** RFC 6455 Section 5.2 @@ -770,7 +769,6 @@ static const struct Curl_cwtype ws_cw_decode = { sizeof(struct ws_cw_ctx) }; - static void ws_enc_info(struct ws_encoder *enc, struct Curl_easy *data, const char *msg) { diff --git a/m4/curl-reentrant.m4 b/m4/curl-reentrant.m4 index 5141622aef..501278eec3 100644 --- a/m4/curl-reentrant.m4 +++ b/m4/curl-reentrant.m4 @@ -184,6 +184,7 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [ fi ]) + dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition diff --git a/scripts/managen b/scripts/managen index bd3a54424c..a537e38432 100755 --- a/scripts/managen +++ b/scripts/managen @@ -1127,7 +1127,7 @@ HEAD $bitmask .= ' | '; } } - $bitmask =~ s/(?=.{76}).{1,76}\|/$&\n /g; + $bitmask =~ s/(?=.{76}).{1,76}\|/$&\n /g; my $arg = $arglong{$long}; if($arg) { $opt .= " $arg"; @@ -1135,7 +1135,7 @@ HEAD my $desc = $helplong{$f}; $desc =~ s/\"/\\\"/g; # escape double quotes - my $line = sprintf " {\"%s\",\n \"%s\",\n %s},\n", $opt, $desc, $bitmask; + my $line = sprintf " { \"%s\",\n \"%s\",\n %s },\n", $opt, $desc, $bitmask; if(length($opt) > 78) { print STDERR "WARN: the --$long name is too long\n"; diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index ca437de501..8d9302f2e1 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -229,8 +229,7 @@ int tool_progress_cb(void *clientp, return 0; } -void progressbarinit(struct ProgressData *bar, - struct OperationConfig *config) +void progressbarinit(struct ProgressData *bar, struct OperationConfig *config) { memset(bar, 0, sizeof(struct ProgressData)); diff --git a/src/tool_cb_prg.h b/src/tool_cb_prg.h index a8b8930616..9c2dda2d7e 100644 --- a/src/tool_cb_prg.h +++ b/src/tool_cb_prg.h @@ -42,8 +42,7 @@ struct ProgressData { struct OperationConfig; -void progressbarinit(struct ProgressData *bar, - struct OperationConfig *config); +void progressbarinit(struct ProgressData *bar, struct OperationConfig *config); /* ** callback for CURLOPT_PROGRESSFUNCTION diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index 6c3cadc7f5..112faf0dc2 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -44,8 +44,8 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) both represent the same value. Maximum offset used here when we lseek using a 'long' data type offset */ -#define OUR_MAX_SEEK_L 2147483647L - 1L -#define OUR_MAX_SEEK_O 0x7FFFFFFF - 0x1 +#define OUR_MAX_SEEK_L (2147483647L - 1L) +#define OUR_MAX_SEEK_O (0x7FFFFFFF - 0x1) /* The offset check following here is only interesting if curl_off_t is larger than off_t and we are not using the Win32 large file support diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index ae6092076c..6b442dd1c9 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -38,7 +38,7 @@ #endif #endif -#define MAX_CONFIG_LINE_LENGTH (10*1024*1024) +#define MAX_CONFIG_LINE_LENGTH (10 * 1024 * 1024) #define checkprefix(a, b) curl_strnequal(b, STRCONST(a)) diff --git a/src/tool_filetime.c b/src/tool_filetime.c index 9e548cd50e..a959af9937 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -44,8 +44,7 @@ int getfiletime(const char *filename, curl_off_t *stamp) TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar(filename); hfile = CreateFile(tchar_filename, FILE_READ_ATTRIBUTES, - (FILE_SHARE_READ | FILE_SHARE_WRITE | - FILE_SHARE_DELETE), + (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), NULL, OPEN_EXISTING, 0, NULL); curlx_free(tchar_filename); if(hfile != INVALID_HANDLE_VALUE) { @@ -110,8 +109,7 @@ void setfiletime(curl_off_t filetime, const char *filename) } hfile = CreateFile(tchar_filename, FILE_WRITE_ATTRIBUTES, - (FILE_SHARE_READ | FILE_SHARE_WRITE | - FILE_SHARE_DELETE), + (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), NULL, OPEN_EXISTING, 0, NULL); curlx_free(tchar_filename); if(hfile != INVALID_HANDLE_VALUE) { diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 543f817cc3..31b381d7e0 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -840,9 +840,9 @@ int formparse(const char *input, part->headers = headers; headers = NULL; if(res == CURLE_READ_ERROR) { - /* An error occurred while reading stdin: if read has started, - issue the error now. Else, delay it until processed by - libcurl. */ + /* An error occurred while reading stdin: if read has started, + issue the error now. Else, delay it until processed by + libcurl. */ if(part->size > 0) { warnf("error while reading standard input"); goto fail; diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c index 18e0d6964e..4ce22bd227 100644 --- a/src/tool_libinfo.c +++ b/src/tool_libinfo.c @@ -61,7 +61,7 @@ static struct proto_name_tokenp { { "scp", &proto_scp }, { "sftp", &proto_sftp }, { "tftp", &proto_tftp }, - { NULL, NULL } + { NULL, NULL } }; bool feature_altsvc = FALSE; @@ -87,38 +87,38 @@ static struct feature_name_presentp { int feature_bitmask; } const maybe_feature[] = { /* Keep alphabetically sorted. */ - {"alt-svc", &feature_altsvc, CURL_VERSION_ALTSVC}, - {"AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS}, - {"brotli", &feature_brotli, CURL_VERSION_BROTLI}, - {"CharConv", NULL, CURL_VERSION_CONV}, - {"Debug", NULL, CURL_VERSION_DEBUG}, - {"ECH", &feature_ech, 0}, - {"gsasl", NULL, CURL_VERSION_GSASL}, - {"GSS-API", NULL, CURL_VERSION_GSSAPI}, - {"HSTS", &feature_hsts, CURL_VERSION_HSTS}, - {"HTTP2", &feature_http2, CURL_VERSION_HTTP2}, - {"HTTP3", &feature_http3, CURL_VERSION_HTTP3}, - {"HTTPS-proxy", &feature_httpsproxy, CURL_VERSION_HTTPS_PROXY}, - {"IDN", NULL, CURL_VERSION_IDN}, - {"IPv6", NULL, CURL_VERSION_IPV6}, - {"Kerberos", NULL, CURL_VERSION_KERBEROS5}, - {"Largefile", NULL, CURL_VERSION_LARGEFILE}, - {"libz", &feature_libz, CURL_VERSION_LIBZ}, - {"MultiSSL", NULL, CURL_VERSION_MULTI_SSL}, - {"NTLM", &feature_ntlm, CURL_VERSION_NTLM}, - {"NTLM_WB", &feature_ntlm_wb, CURL_VERSION_NTLM_WB}, - {"PSL", NULL, CURL_VERSION_PSL}, - {"SPNEGO", &feature_spnego, CURL_VERSION_SPNEGO}, - {"SSL", &feature_ssl, CURL_VERSION_SSL}, - {"SSPI", NULL, CURL_VERSION_SSPI}, - {"SSLS-EXPORT", &feature_ssls_export, 0}, - {"threadsafe", NULL, CURL_VERSION_THREADSAFE}, - {"TLS-SRP", &feature_tls_srp, CURL_VERSION_TLSAUTH_SRP}, - {"TrackMemory", NULL, CURL_VERSION_CURLDEBUG}, - {"Unicode", NULL, CURL_VERSION_UNICODE}, - {"UnixSockets", NULL, CURL_VERSION_UNIX_SOCKETS}, - {"zstd", &feature_zstd, CURL_VERSION_ZSTD}, - {NULL, NULL, 0} + { "alt-svc", &feature_altsvc, CURL_VERSION_ALTSVC }, + { "AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS }, + { "brotli", &feature_brotli, CURL_VERSION_BROTLI }, + { "CharConv", NULL, CURL_VERSION_CONV }, + { "Debug", NULL, CURL_VERSION_DEBUG }, + { "ECH", &feature_ech, 0 }, + { "gsasl", NULL, CURL_VERSION_GSASL }, + { "GSS-API", NULL, CURL_VERSION_GSSAPI }, + { "HSTS", &feature_hsts, CURL_VERSION_HSTS }, + { "HTTP2", &feature_http2, CURL_VERSION_HTTP2 }, + { "HTTP3", &feature_http3, CURL_VERSION_HTTP3 }, + { "HTTPS-proxy", &feature_httpsproxy, CURL_VERSION_HTTPS_PROXY }, + { "IDN", NULL, CURL_VERSION_IDN }, + { "IPv6", NULL, CURL_VERSION_IPV6 }, + { "Kerberos", NULL, CURL_VERSION_KERBEROS5 }, + { "Largefile", NULL, CURL_VERSION_LARGEFILE }, + { "libz", &feature_libz, CURL_VERSION_LIBZ }, + { "MultiSSL", NULL, CURL_VERSION_MULTI_SSL }, + { "NTLM", &feature_ntlm, CURL_VERSION_NTLM }, + { "NTLM_WB", &feature_ntlm_wb, CURL_VERSION_NTLM_WB }, + { "PSL", NULL, CURL_VERSION_PSL }, + { "SPNEGO", &feature_spnego, CURL_VERSION_SPNEGO }, + { "SSL", &feature_ssl, CURL_VERSION_SSL }, + { "SSPI", NULL, CURL_VERSION_SSPI }, + { "SSLS-EXPORT", &feature_ssls_export, 0 }, + { "threadsafe", NULL, CURL_VERSION_THREADSAFE }, + { "TLS-SRP", &feature_tls_srp, CURL_VERSION_TLSAUTH_SRP }, + { "TrackMemory", NULL, CURL_VERSION_CURLDEBUG }, + { "Unicode", NULL, CURL_VERSION_UNICODE }, + { "UnixSockets", NULL, CURL_VERSION_UNIX_SOCKETS }, + { "zstd", &feature_zstd, CURL_VERSION_ZSTD }, + { NULL, NULL, 0 } }; static const char *fnames[CURL_ARRAYSIZE(maybe_feature)]; @@ -186,7 +186,7 @@ CURLcode get_libcurl_info(void) } feature_libssh2 = curlinfo->libssh_version && - !strncmp("libssh2", curlinfo->libssh_version, 7); + !strncmp("libssh2", curlinfo->libssh_version, 7); return CURLE_OK; } diff --git a/src/tool_listhelp.c b/src/tool_listhelp.c index 21019c7de1..48a32214b8 100644 --- a/src/tool_listhelp.c +++ b/src/tool_listhelp.c @@ -33,831 +33,831 @@ */ const struct helptxt helptext[] = { - {" --abstract-unix-socket ", - "Connect via abstract Unix domain socket", - CURLHELP_CONNECTION}, - {" --alt-svc ", - "Enable alt-svc with this cache file", - CURLHELP_HTTP}, - {" --anyauth", - "Pick any authentication method", - CURLHELP_HTTP | CURLHELP_PROXY | CURLHELP_AUTH}, - {"-a, --append", - "Append to target file when uploading", - CURLHELP_FTP | CURLHELP_SFTP}, - {" --aws-sigv4 ", - "AWS V4 signature auth", - CURLHELP_AUTH | CURLHELP_HTTP}, - {" --basic", - "HTTP Basic Authentication", - CURLHELP_AUTH}, - {" --ca-native", - "Load CA certs from the OS", - CURLHELP_TLS}, - {" --cacert ", - "CA certificate to verify peer against", - CURLHELP_TLS}, - {" --capath ", - "CA directory to verify peer against", - CURLHELP_TLS}, - {"-E, --cert ", - "Client certificate file and password", - CURLHELP_TLS}, - {" --cert-status", - "Verify server cert status OCSP-staple", - CURLHELP_TLS}, - {" --cert-type ", - "Certificate type (DER/PEM/ENG/PROV/P12)", - CURLHELP_TLS}, - {" --ciphers ", - "TLS 1.2 (1.1, 1.0) ciphers to use", - CURLHELP_TLS}, - {" --compressed", - "Request compressed response", - CURLHELP_HTTP}, - {" --compressed-ssh", - "Enable SSH compression", - CURLHELP_SCP | CURLHELP_SSH}, - {"-K, --config ", - "Read config from a file", - CURLHELP_CURL}, - {" --connect-timeout ", - "Maximum time allowed to connect", - CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, - {" --connect-to ", - "Connect to host2 instead of host1", - CURLHELP_CONNECTION | CURLHELP_DNS}, - {"-C, --continue-at ", - "Resumed transfer offset", - CURLHELP_CONNECTION}, - {"-b, --cookie ", - "Send cookies from string/load from file", - CURLHELP_HTTP}, - {"-c, --cookie-jar ", - "Save cookies to after operation", - CURLHELP_HTTP}, - {" --create-dirs", - "Create necessary local directory hierarchy", - CURLHELP_OUTPUT}, - {" --create-file-mode ", - "File mode for created files", - CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_FILE | CURLHELP_UPLOAD}, - {" --crlf", - "Convert LF to CRLF in upload", - CURLHELP_FTP | CURLHELP_SMTP}, - {" --crlfile ", - "Certificate Revocation list", - CURLHELP_TLS}, - {" --curves ", - "(EC) TLS key exchange algorithms to request", - CURLHELP_TLS}, - {"-d, --data ", - "HTTP POST data", - CURLHELP_IMPORTANT | CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {" --data-ascii ", - "HTTP POST ASCII data", - CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {" --data-binary ", - "HTTP POST binary data", - CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {" --data-raw ", - "HTTP POST data, '@' allowed", - CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {" --data-urlencode ", - "HTTP POST data URL encoded", - CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {" --delegation ", - "GSS-API delegation permission", - CURLHELP_AUTH}, - {" --digest", - "HTTP Digest Authentication", - CURLHELP_PROXY | CURLHELP_AUTH | CURLHELP_HTTP}, - {"-q, --disable", - "Disable .curlrc", - CURLHELP_CURL}, - {" --disable-eprt", - "Inhibit using EPRT or LPRT", - CURLHELP_FTP}, - {" --disable-epsv", - "Inhibit using EPSV", - CURLHELP_FTP}, - {" --disallow-username-in-url", - "Disallow username in URL", - CURLHELP_CURL}, - {" --dns-interface ", - "Interface to use for DNS requests", - CURLHELP_DNS}, - {" --dns-ipv4-addr
", - "IPv4 address to use for DNS requests", - CURLHELP_DNS}, - {" --dns-ipv6-addr
", - "IPv6 address to use for DNS requests", - CURLHELP_DNS}, - {" --dns-servers ", - "DNS server addrs to use", - CURLHELP_DNS}, - {" --doh-cert-status", - "Verify DoH server cert status OCSP-staple", - CURLHELP_DNS | CURLHELP_TLS}, - {" --doh-insecure", - "Allow insecure DoH server connections", - CURLHELP_DNS | CURLHELP_TLS}, - {" --doh-url ", - "Resolve hostnames over DoH", - CURLHELP_DNS}, - {" --dump-ca-embed", - "Write the embedded CA bundle to standard output", - CURLHELP_HTTP | CURLHELP_PROXY | CURLHELP_TLS}, - {"-D, --dump-header ", - "Write the received headers to ", - CURLHELP_HTTP | CURLHELP_FTP}, - {" --ech ", - "Configure ECH", - CURLHELP_TLS}, - {" --egd-file ", - "EGD socket path for random data", - CURLHELP_DEPRECATED}, - {" --engine ", - "Crypto engine to use", - CURLHELP_TLS}, - {" --etag-compare ", - "Load ETag from file", - CURLHELP_HTTP}, - {" --etag-save ", - "Parse incoming ETag and save to a file", - CURLHELP_HTTP}, - {" --expect100-timeout ", - "How long to wait for 100-continue", - CURLHELP_HTTP | CURLHELP_TIMEOUT}, - {"-f, --fail", - "Fail fast with no output on HTTP errors", - CURLHELP_IMPORTANT | CURLHELP_HTTP}, - {" --fail-early", - "Fail on first transfer error", - CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --fail-with-body", - "Fail on HTTP errors but save the body", - CURLHELP_HTTP | CURLHELP_OUTPUT}, - {" --false-start", - "Enable TLS False Start", - CURLHELP_DEPRECATED}, - {" --follow", - "Follow redirects per spec", - CURLHELP_HTTP}, - {"-F, --form ", - "Specify multipart MIME data", - CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_IMAP | - CURLHELP_SMTP}, - {" --form-escape", - "Escape form fields using backslash", - CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST}, - {" --form-string ", - "Specify multipart MIME data", - CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_SMTP | - CURLHELP_IMAP}, - {" --ftp-account ", - "Account data string", - CURLHELP_FTP | CURLHELP_AUTH}, - {" --ftp-alternative-to-user ", - "String to replace USER [name]", - CURLHELP_FTP}, - {" --ftp-create-dirs", - "Create the remote dirs if not present", - CURLHELP_FTP | CURLHELP_SFTP}, - {" --ftp-method ", - "Control CWD usage", - CURLHELP_FTP}, - {" --ftp-pasv", - "Send PASV/EPSV instead of PORT", - CURLHELP_FTP}, - {"-P, --ftp-port
", - "Send PORT instead of PASV", - CURLHELP_FTP}, - {" --ftp-pret", - "Send PRET before PASV", - CURLHELP_FTP}, - {" --ftp-skip-pasv-ip", - "Skip the IP address for PASV", - CURLHELP_FTP}, - {" --ftp-ssl-ccc", - "Send CCC after authenticating", - CURLHELP_FTP | CURLHELP_TLS}, - {" --ftp-ssl-ccc-mode ", - "Set CCC mode", - CURLHELP_FTP | CURLHELP_TLS}, - {" --ftp-ssl-control", - "Require TLS for login, clear for transfer", - CURLHELP_FTP | CURLHELP_TLS}, - {"-G, --get", - "Put the post data in the URL and use GET", - CURLHELP_HTTP}, - {"-g, --globoff", - "Disable URL globbing with {} and []", - CURLHELP_CURL}, - {" --happy-eyeballs-timeout-ms ", - "Time for IPv6 before IPv4", - CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, - {" --haproxy-clientip ", - "Set address in HAProxy PROXY", - CURLHELP_HTTP | CURLHELP_PROXY}, - {" --haproxy-protocol", - "Send HAProxy PROXY protocol v1 header", - CURLHELP_HTTP | CURLHELP_PROXY}, - {"-I, --head", - "Show document info only", - CURLHELP_HTTP | CURLHELP_FTP | CURLHELP_FILE}, - {"-H, --header
", - "Pass custom header(s) to server", - CURLHELP_HTTP | CURLHELP_IMAP | CURLHELP_SMTP}, - {"-h, --help ", - "Get help for commands", - CURLHELP_IMPORTANT | CURLHELP_CURL}, - {" --hostpubmd5 ", - "Acceptable MD5 hash of host public key", - CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, - {" --hostpubsha256 ", - "Acceptable SHA256 hash of host public key", - CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, - {" --hsts ", - "Enable HSTS with this cache file", - CURLHELP_HTTP}, - {" --http0.9", - "Allow HTTP/0.9 responses", - CURLHELP_HTTP}, - {"-0, --http1.0", - "Use HTTP/1.0", - CURLHELP_HTTP}, - {" --http1.1", - "Use HTTP/1.1", - CURLHELP_HTTP}, - {" --http2", - "Use HTTP/2", - CURLHELP_HTTP}, - {" --http2-prior-knowledge", - "Use HTTP/2 without HTTP/1.1 Upgrade", - CURLHELP_HTTP}, - {" --http3", - "Use HTTP/3", - CURLHELP_HTTP}, - {" --http3-only", - "Use HTTP/3 only", - CURLHELP_HTTP}, - {" --ignore-content-length", - "Ignore the size of the remote resource", - CURLHELP_HTTP | CURLHELP_FTP}, - {"-k, --insecure", - "Allow insecure server connections", - CURLHELP_TLS | CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, - {" --interface ", - "Use network interface", - CURLHELP_CONNECTION}, - {" --ip-tos ", - "Set IP Type of Service or Traffic Class", - CURLHELP_CONNECTION}, - {" --ipfs-gateway ", - "Gateway for IPFS", - CURLHELP_CURL}, - {"-4, --ipv4", - "Resolve names to IPv4 addresses", - CURLHELP_CONNECTION | CURLHELP_DNS}, - {"-6, --ipv6", - "Resolve names to IPv6 addresses", - CURLHELP_CONNECTION | CURLHELP_DNS}, - {" --json ", - "HTTP POST JSON", - CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, - {"-j, --junk-session-cookies", - "Ignore session cookies read from file", - CURLHELP_HTTP}, - {" --keepalive-cnt ", - "Maximum number of keepalive probes", - CURLHELP_CONNECTION}, - {" --keepalive-time ", - "Interval time for keepalive probes", - CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, - {" --key ", - "Private key filename", - CURLHELP_TLS | CURLHELP_SSH}, - {" --key-type ", - "Private key file type (DER/PEM/ENG)", - CURLHELP_TLS}, - {" --knownhosts ", - "Specify knownhosts path", - CURLHELP_SSH}, - {" --krb ", - "Enable Kerberos with security ", - CURLHELP_DEPRECATED}, - {" --libcurl ", - "Generate libcurl code for this command line", - CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --limit-rate ", - "Limit transfer speed to RATE", - CURLHELP_CONNECTION}, - {"-l, --list-only", - "List only mode", - CURLHELP_FTP | CURLHELP_POP3 | CURLHELP_SFTP | CURLHELP_FILE}, - {" --local-port ", - "Use a local port number within RANGE", - CURLHELP_CONNECTION}, - {"-L, --location", - "Follow redirects", - CURLHELP_HTTP}, - {" --location-trusted", - "As --location, but send secrets to other hosts", - CURLHELP_HTTP | CURLHELP_AUTH}, - {" --login-options ", - "Server login options", - CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | CURLHELP_AUTH | - CURLHELP_LDAP}, - {" --mail-auth
", - "Originator address of the original email", - CURLHELP_SMTP}, - {" --mail-from
", - "Mail from this address", - CURLHELP_SMTP}, - {" --mail-rcpt
", - "Mail to this address", - CURLHELP_SMTP}, - {" --mail-rcpt-allowfails", - "Allow RCPT TO command to fail", - CURLHELP_SMTP}, - {"-M, --manual", - "Display the full manual", - CURLHELP_CURL}, - {" --max-filesize ", - "Maximum file size to download", - CURLHELP_CONNECTION}, - {" --max-redirs ", - "Maximum number of redirects allowed", - CURLHELP_HTTP}, - {"-m, --max-time ", - "Maximum time allowed for transfer", - CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, - {" --metalink", - "Process given URLs as metalink XML file", - CURLHELP_DEPRECATED}, - {" --mptcp", - "Enable Multipath TCP", - CURLHELP_CONNECTION}, - {" --negotiate", - "Use HTTP Negotiate (SPNEGO) authentication", - CURLHELP_AUTH | CURLHELP_HTTP}, - {"-n, --netrc", - "Must read .netrc for username and password", - CURLHELP_AUTH}, - {" --netrc-file ", - "Specify FILE for netrc", - CURLHELP_AUTH}, - {" --netrc-optional", - "Use either .netrc or URL", - CURLHELP_AUTH}, - {"-:, --next", - "Make next URL use separate options", - CURLHELP_CURL}, - {" --no-alpn", - "Disable the ALPN TLS extension", - CURLHELP_TLS | CURLHELP_HTTP}, - {"-N, --no-buffer", - "Disable buffering of the output stream", - CURLHELP_OUTPUT}, - {" --no-clobber", - "Do not overwrite files that already exist", - CURLHELP_OUTPUT}, - {" --no-keepalive", - "Disable TCP keepalive on the connection", - CURLHELP_CONNECTION}, - {" --no-npn", - "Disable the NPN TLS extension", - CURLHELP_DEPRECATED}, - {" --no-progress-meter", - "Do not show the progress meter", - CURLHELP_VERBOSE}, - {" --no-sessionid", - "Disable SSL session-ID reusing", - CURLHELP_TLS}, - {" --noproxy ", - "List of hosts which do not use proxy", - CURLHELP_PROXY}, - {" --ntlm", - "HTTP NTLM authentication", - CURLHELP_AUTH | CURLHELP_HTTP}, - {" --ntlm-wb", - "HTTP NTLM authentication with winbind", - CURLHELP_DEPRECATED}, - {" --oauth2-bearer ", - "OAuth 2 Bearer Token", - CURLHELP_AUTH | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | - CURLHELP_LDAP}, - {" --out-null", - "Discard response data into the void", - CURLHELP_OUTPUT}, - {"-o, --output ", - "Write to file instead of stdout", - CURLHELP_IMPORTANT | CURLHELP_OUTPUT}, - {" --output-dir ", - "Directory to save files in", - CURLHELP_OUTPUT}, - {"-Z, --parallel", - "Perform transfers in parallel", - CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --parallel-immediate", - "Do not wait for multiplexing", - CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --parallel-max ", - "Maximum concurrency for parallel transfers", - CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --parallel-max-host ", - "Maximum connections to a single host", - CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, - {" --pass ", - "Passphrase for the private key", - CURLHELP_SSH | CURLHELP_TLS | CURLHELP_AUTH}, - {" --path-as-is", - "Do not squash .. sequences in URL path", - CURLHELP_CURL}, - {" --pinnedpubkey ", - "Public key to verify peer against", - CURLHELP_TLS}, - {" --post301", - "Do not switch to GET after a 301 redirect", - CURLHELP_HTTP | CURLHELP_POST}, - {" --post302", - "Do not switch to GET after a 302 redirect", - CURLHELP_HTTP | CURLHELP_POST}, - {" --post303", - "Do not switch to GET after a 303 redirect", - CURLHELP_HTTP | CURLHELP_POST}, - {" --preproxy <[protocol://]host[:port]>", - "Use this proxy first", - CURLHELP_PROXY}, - {"-#, --progress-bar", - "Display transfer progress as a bar", - CURLHELP_VERBOSE | CURLHELP_GLOBAL}, - {" --proto ", - "Enable/disable PROTOCOLS", - CURLHELP_CONNECTION | CURLHELP_CURL}, - {" --proto-default ", - "Use PROTOCOL for any URL missing a scheme", - CURLHELP_CONNECTION | CURLHELP_CURL}, - {" --proto-redir ", - "Enable/disable PROTOCOLS on redirect", - CURLHELP_CONNECTION | CURLHELP_CURL}, - {"-x, --proxy <[protocol://]host[:port]>", - "Use this proxy", - CURLHELP_PROXY}, - {" --proxy-anyauth", - "Pick any proxy authentication method", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --proxy-basic", - "Use Basic authentication on the proxy", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --proxy-ca-native", - "Load CA certs from the OS to verify proxy", - CURLHELP_TLS}, - {" --proxy-cacert ", - "CA certificates to verify proxy against", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-capath ", - "CA directory to verify proxy against", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-cert ", - "Set client certificate for proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-cert-type ", - "Client certificate type for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-ciphers ", - "TLS 1.2 (1.1, 1.0) ciphers to use for proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-crlfile ", - "Set a CRL list for proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-digest", - "Digest auth with the proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-header
", - "Pass custom header(s) to proxy", - CURLHELP_PROXY}, - {" --proxy-http2", - "Use HTTP/2 with HTTPS proxy", - CURLHELP_HTTP | CURLHELP_PROXY}, - {" --proxy-insecure", - "Skip HTTPS proxy cert verification", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-key ", - "Private key for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-key-type ", - "Private key file type for proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-negotiate", - "HTTP Negotiate (SPNEGO) auth with the proxy", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --proxy-ntlm", - "NTLM authentication with the proxy", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --proxy-pass ", - "Passphrase for private key for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, - {" --proxy-pinnedpubkey ", - "FILE/HASHES public key to verify proxy with", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-service-name ", - "SPNEGO proxy service name", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-ssl-allow-beast", - "Allow this security flaw for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-ssl-auto-client-cert", - "Auto client certificate for proxy", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-tls13-ciphers ", - "TLS 1.3 proxy cipher suites", - CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-tlsauthtype ", - "TLS authentication type for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, - {" --proxy-tlspassword ", - "TLS password for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, - {" --proxy-tlsuser ", - "TLS username for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, - {" --proxy-tlsv1", - "TLSv1 for HTTPS proxy", - CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, - {"-U, --proxy-user ", - "Proxy user and password", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --proxy1.0 ", - "Use HTTP/1.0 proxy on given port", - CURLHELP_PROXY}, - {"-p, --proxytunnel", - "HTTP proxy tunnel (using CONNECT)", - CURLHELP_PROXY}, - {" --pubkey ", - "SSH Public key filename", - CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH | CURLHELP_AUTH}, - {"-Q, --quote ", - "Send command(s) to server before transfer", - CURLHELP_FTP | CURLHELP_SFTP}, - {" --random-file ", - "File for reading random data from", - CURLHELP_DEPRECATED}, - {"-r, --range ", - "Retrieve only the bytes within RANGE", - CURLHELP_HTTP | CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_FILE}, - {" --rate ", - "Request rate for serial transfers", - CURLHELP_CONNECTION | CURLHELP_GLOBAL}, - {" --raw", - "Do HTTP raw; no transfer decoding", - CURLHELP_HTTP}, - {"-e, --referer ", - "Referrer URL", - CURLHELP_HTTP}, - {"-J, --remote-header-name", - "Use the header-provided filename", - CURLHELP_OUTPUT}, - {"-O, --remote-name", - "Write output to file named as remote file", - CURLHELP_IMPORTANT | CURLHELP_OUTPUT}, - {" --remote-name-all", - "Use the remote filename for all URLs", - CURLHELP_OUTPUT}, - {"-R, --remote-time", - "Set remote file's time on local output", - CURLHELP_OUTPUT}, - {" --remove-on-error", - "Remove output file on errors", - CURLHELP_OUTPUT}, - {"-X, --request ", - "Specify request method to use", - CURLHELP_CONNECTION | CURLHELP_POP3 | CURLHELP_FTP | CURLHELP_IMAP | - CURLHELP_SMTP}, - {" --request-target ", - "Specify the target for this request", - CURLHELP_HTTP}, - {" --resolve <[+]host:port:addr[,addr]...>", - "Resolve host+port to address", - CURLHELP_CONNECTION | CURLHELP_DNS}, - {" --retry ", - "Retry request if transient problems occur", - CURLHELP_CURL}, - {" --retry-all-errors", - "Retry all errors (with --retry)", - CURLHELP_CURL}, - {" --retry-connrefused", - "Retry on connection refused (with --retry)", - CURLHELP_CURL}, - {" --retry-delay ", - "Wait time between retries", - CURLHELP_CURL | CURLHELP_TIMEOUT}, - {" --retry-max-time ", - "Retry only within this period", - CURLHELP_CURL | CURLHELP_TIMEOUT}, - {" --sasl-authzid ", - "Identity for SASL PLAIN authentication", - CURLHELP_AUTH}, - {" --sasl-ir", - "Initial response in SASL authentication", - CURLHELP_AUTH}, - {" --service-name ", - "SPNEGO service name", - CURLHELP_AUTH}, - {"-S, --show-error", - "Show error even when -s is used", - CURLHELP_CURL | CURLHELP_GLOBAL}, - {"-i, --show-headers", - "Show response headers in output", - CURLHELP_IMPORTANT | CURLHELP_VERBOSE | CURLHELP_OUTPUT}, - {" --sigalgs ", - "TLS signature algorithms to use", - CURLHELP_TLS}, - {"-s, --silent", - "Silent mode", - CURLHELP_IMPORTANT | CURLHELP_VERBOSE}, - {" --skip-existing", - "Skip download if local file already exists", - CURLHELP_CURL | CURLHELP_OUTPUT}, - {" --socks4 ", - "SOCKS4 proxy on given host + port", - CURLHELP_PROXY}, - {" --socks4a ", - "SOCKS4a proxy on given host + port", - CURLHELP_PROXY}, - {" --socks5 ", - "SOCKS5 proxy on given host + port", - CURLHELP_PROXY}, - {" --socks5-basic", - "Username/password auth for SOCKS5 proxies", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --socks5-gssapi", - "Enable GSS-API auth for SOCKS5 proxies", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --socks5-gssapi-nec", - "Compatibility with NEC SOCKS5 server", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --socks5-gssapi-service ", - "SOCKS5 proxy service name for GSS-API", - CURLHELP_PROXY | CURLHELP_AUTH}, - {" --socks5-hostname ", - "SOCKS5 proxy, pass hostname to proxy", - CURLHELP_PROXY}, - {"-Y, --speed-limit ", - "Stop transfers slower than this", - CURLHELP_CONNECTION}, - {"-y, --speed-time ", - "Trigger 'speed-limit' abort after this time", - CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, - {" --ssl", - "Try enabling TLS", - CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | - CURLHELP_LDAP}, - {" --ssl-allow-beast", - "Allow security flaw to improve interop", - CURLHELP_TLS}, - {" --ssl-auto-client-cert", - "Use auto client certificate (Schannel)", - CURLHELP_TLS}, - {" --ssl-no-revoke", - "Disable cert revocation checks (Schannel)", - CURLHELP_TLS}, - {" --ssl-reqd", - "Require SSL/TLS", - CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | - CURLHELP_LDAP}, - {" --ssl-revoke-best-effort", - "Ignore missing cert CRL dist points", - CURLHELP_TLS}, - {" --ssl-sessions ", - "Load/save SSL session tickets from/to this file", - CURLHELP_TLS}, - {"-2, --sslv2", - "SSLv2", - CURLHELP_DEPRECATED}, - {"-3, --sslv3", - "SSLv3", - CURLHELP_DEPRECATED}, - {" --stderr ", - "Where to redirect stderr", - CURLHELP_VERBOSE | CURLHELP_GLOBAL}, - {" --styled-output", - "Enable styled output for HTTP headers", - CURLHELP_VERBOSE | CURLHELP_GLOBAL}, - {" --suppress-connect-headers", - "Suppress proxy CONNECT response headers", - CURLHELP_PROXY}, - {" --tcp-fastopen", - "Use TCP Fast Open", - CURLHELP_CONNECTION}, - {" --tcp-nodelay", - "Set TCP_NODELAY", - CURLHELP_CONNECTION}, - {"-t, --telnet-option ", - "Set telnet option", - CURLHELP_TELNET}, - {" --tftp-blksize ", - "Set TFTP BLKSIZE option", - CURLHELP_TFTP}, - {" --tftp-no-options", - "Do not send any TFTP options", - CURLHELP_TFTP}, - {"-z, --time-cond