tidy-up: miscellaneous

- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55df #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b #20076

Closes #20070
This commit is contained in:
Viktor Szakats
2025-12-20 14:32:49 +01:00
parent abcb10f3ac
commit 7032982896
314 changed files with 486 additions and 730 deletions

View File

@@ -36,13 +36,13 @@ CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, si
The `type` argument specifies what the bytes in `buf` actually are.
The following bits are defined:
```
#define CLIENTWRITE_BODY (1<<0) /* non-meta information, BODY */
#define CLIENTWRITE_INFO (1<<1) /* meta information, not a HEADER */
#define CLIENTWRITE_HEADER (1<<2) /* meta information, HEADER */
#define CLIENTWRITE_STATUS (1<<3) /* a special status HEADER */
#define CLIENTWRITE_CONNECT (1<<4) /* a CONNECT related HEADER */
#define CLIENTWRITE_1XX (1<<5) /* a 1xx response related HEADER */
#define CLIENTWRITE_TRAILER (1<<6) /* a trailer HEADER */
#define CLIENTWRITE_BODY (1 << 0) /* non-meta information, BODY */
#define CLIENTWRITE_INFO (1 << 1) /* meta information, not a HEADER */
#define CLIENTWRITE_HEADER (1 << 2) /* meta information, HEADER */
#define CLIENTWRITE_STATUS (1 << 3) /* a special status HEADER */
#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
#define CLIENTWRITE_1XX (1 << 5) /* a 1xx response related HEADER */
#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
```
The main types here are `CLIENTWRITE_BODY` and `CLIENTWRITE_HEADER`. They are

View File

@@ -393,6 +393,7 @@ This is the full list of functions generally banned.
sscanf
stat
strcat
strcpy
strdup
strerror
strncat

View File

@@ -54,7 +54,7 @@ This, because first then does libcurl known which actual read callback to use.
size_t print_httppost_callback(void *arg, const char *buf, size_t len)
{
fwrite(buf, len, 1, stdout);
(*(size_t *)arg) += len;
*((size_t *)arg) += len;
return len;
}

View File

@@ -22,10 +22,10 @@ CURLOPT_ALTSVC_CTRL - control alt-svc behavior
~~~c
#include <curl/curl.h>
#define CURLALTSVC_READONLYFILE (1L<<2)
#define CURLALTSVC_H1 (1L<<3)
#define CURLALTSVC_H2 (1L<<4)
#define CURLALTSVC_H3 (1L<<5)
#define CURLALTSVC_READONLYFILE (1L << 2)
#define CURLALTSVC_H1 (1L << 3)
#define CURLALTSVC_H2 (1L << 4)
#define CURLALTSVC_H3 (1L << 5)
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask);
~~~

View File

@@ -23,8 +23,8 @@ CURLOPT_HSTS_CTRL - control HSTS behavior
~~~c
#include <curl/curl.h>
#define CURLHSTS_ENABLE (1L<<0)
#define CURLHSTS_READONLYFILE (1L<<1)
#define CURLHSTS_ENABLE (1L << 0)
#define CURLHSTS_READONLYFILE (1L << 1)
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask);
~~~

View File

@@ -52,7 +52,7 @@ open F, "<symbols-in-versions";
sub str2num {
my ($str)=@_;
if($str && $str =~ /([0-9]*)\.([0-9]*)\.*([0-9]*)/) {
return sprintf("0x%06x", $1 <<16 | $2 << 8 | ($3 || '0'));
return sprintf("0x%06x", $1 << 16 | $2 << 8 | ($3 || '0'));
}
}

View File

@@ -202,22 +202,22 @@ struct curl_httppost {
long flags; /* as defined below */
/* specified content is a filename */
#define CURL_HTTPPOST_FILENAME (1<<0)
#define CURL_HTTPPOST_FILENAME (1 << 0)
/* specified content is a filename */
#define CURL_HTTPPOST_READFILE (1<<1)
#define CURL_HTTPPOST_READFILE (1 << 1)
/* name is only stored pointer do not free in formfree */
#define CURL_HTTPPOST_PTRNAME (1<<2)
#define CURL_HTTPPOST_PTRNAME (1 << 2)
/* contents is only stored pointer do not free in formfree */
#define CURL_HTTPPOST_PTRCONTENTS (1<<3)
#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
/* upload file from buffer */
#define CURL_HTTPPOST_BUFFER (1<<4)
#define CURL_HTTPPOST_BUFFER (1 << 4)
/* upload file from pointer contents */
#define CURL_HTTPPOST_PTRBUFFER (1<<5)
#define CURL_HTTPPOST_PTRBUFFER (1 << 5)
/* upload file contents by using the regular read callback to get the data and
pass the given pointer as custom pointer */
#define CURL_HTTPPOST_CALLBACK (1<<6)
#define CURL_HTTPPOST_CALLBACK (1 << 6)
/* use size in 'contentlen', added in 7.46.0 */
#define CURL_HTTPPOST_LARGE (1<<7)
#define CURL_HTTPPOST_LARGE (1 << 7)
char *showfilename; /* The filename to show. If not set, the
actual filename will be used (if this
@@ -303,14 +303,14 @@ typedef enum {
CURLFILETYPE_UNKNOWN /* should never occur */
} curlfiletype;
#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
#define CURLFINFOFLAG_KNOWN_UID (1<<4)
#define CURLFINFOFLAG_KNOWN_GID (1<<5)
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
#define CURLFINFOFLAG_KNOWN_FILENAME (1 << 0)
#define CURLFINFOFLAG_KNOWN_FILETYPE (1 << 1)
#define CURLFINFOFLAG_KNOWN_TIME (1 << 2)
#define CURLFINFOFLAG_KNOWN_PERM (1 << 3)
#define CURLFINFOFLAG_KNOWN_UID (1 << 4)
#define CURLFINFOFLAG_KNOWN_GID (1 << 5)
#define CURLFINFOFLAG_KNOWN_SIZE (1 << 6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1 << 7)
/* Information about a single file, used when doing FTP wildcard matching */
struct curl_fileinfo {
@@ -826,34 +826,34 @@ typedef enum {
*/
#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_BASIC (((unsigned long)1) << 0)
#define CURLAUTH_DIGEST (((unsigned long)1) << 1)
#define CURLAUTH_NEGOTIATE (((unsigned long)1) << 2)
/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM (((unsigned long)1) << 3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1) << 4)
#ifndef CURL_NO_OLDIES
/* functionality removed since 8.8.0 */
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_NTLM_WB (((unsigned long)1) << 5)
#endif
#define CURLAUTH_BEARER (((unsigned long)1)<<6)
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_BEARER (((unsigned long)1) << 6)
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1) << 7)
#define CURLAUTH_ONLY (((unsigned long)1) << 31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1L<<0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1L<<1) /* password */
#define CURLSSH_AUTH_HOST (1L<<2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1L<<3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1L<<4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1L<<5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLSSH_AUTH_ANY ~0L /* all types supported by server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1L << 0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1L << 1) /* password */
#define CURLSSH_AUTH_HOST (1L << 2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1L << 3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1L << 4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1L << 5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0L /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */
@@ -932,31 +932,31 @@ typedef enum {
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1L<<0)
#define CURLSSLOPT_ALLOW_BEAST (1L << 0)
/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
SSL backends where such behavior is present. */
#define CURLSSLOPT_NO_REVOKE (1L<<1)
#define CURLSSLOPT_NO_REVOKE (1L << 1)
/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
if possible. The OpenSSL backend has this ability. */
#define CURLSSLOPT_NO_PARTIALCHAIN (1L<<2)
#define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)
/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
checks and ignore missing revocation list for those SSL backends where such
behavior is present. */
#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L<<3)
#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)
/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
operating system. Currently implemented under MS-Windows. */
#define CURLSSLOPT_NATIVE_CA (1L<<4)
#define CURLSSLOPT_NATIVE_CA (1L << 4)
/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
a client certificate for authentication. (Schannel) */
#define CURLSSLOPT_AUTO_CLIENT_CERT (1L<<5)
#define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)
/* If possible, send data using TLS 1.3 early data */
#define CURLSSLOPT_EARLYDATA (1L<<6)
#define CURLSSLOPT_EARLYDATA (1L << 6)
/* The default connection attempt delay in milliseconds for happy eyeballs.
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
@@ -1023,20 +1023,20 @@ typedef enum {
/* bitmask defines for CURLOPT_HEADEROPT */
#define CURLHEADER_UNIFIED 0L
#define CURLHEADER_SEPARATE (1L<<0)
#define CURLHEADER_SEPARATE (1L << 0)
/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
#define CURLALTSVC_READONLYFILE (1L<<2)
#define CURLALTSVC_H1 (1L<<3)
#define CURLALTSVC_H2 (1L<<4)
#define CURLALTSVC_H3 (1L<<5)
#define CURLALTSVC_READONLYFILE (1L << 2)
#define CURLALTSVC_H1 (1L << 3)
#define CURLALTSVC_H2 (1L << 4)
#define CURLALTSVC_H3 (1L << 5)
/* bitmask values for CURLOPT_UPLOAD_FLAGS */
#define CURLULFLAG_ANSWERED (1L<<0)
#define CURLULFLAG_DELETED (1L<<1)
#define CURLULFLAG_DRAFT (1L<<2)
#define CURLULFLAG_FLAGGED (1L<<3)
#define CURLULFLAG_SEEN (1L<<4)
#define CURLULFLAG_ANSWERED (1L << 0)
#define CURLULFLAG_DELETED (1L << 1)
#define CURLULFLAG_DRAFT (1L << 2)
#define CURLULFLAG_FLAGGED (1L << 3)
#define CURLULFLAG_SEEN (1L << 4)
struct curl_hstsentry {
char *name;
@@ -1065,41 +1065,41 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
void *userp);
/* CURLHSTS_* are bits for the CURLOPT_HSTS option */
#define CURLHSTS_ENABLE (1L<<0)
#define CURLHSTS_READONLYFILE (1L<<1)
#define CURLHSTS_ENABLE (1L << 0)
#define CURLHSTS_READONLYFILE (1L << 1)
/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
options. Do not use. */
#define CURLPROTO_HTTP (1L<<0)
#define CURLPROTO_HTTPS (1L<<1)
#define CURLPROTO_FTP (1L<<2)
#define CURLPROTO_FTPS (1L<<3)
#define CURLPROTO_SCP (1L<<4)
#define CURLPROTO_SFTP (1L<<5)
#define CURLPROTO_TELNET (1L<<6)
#define CURLPROTO_LDAP (1L<<7)
#define CURLPROTO_LDAPS (1L<<8)
#define CURLPROTO_DICT (1L<<9)
#define CURLPROTO_FILE (1L<<10)
#define CURLPROTO_TFTP (1L<<11)
#define CURLPROTO_IMAP (1L<<12)
#define CURLPROTO_IMAPS (1L<<13)
#define CURLPROTO_POP3 (1L<<14)
#define CURLPROTO_POP3S (1L<<15)
#define CURLPROTO_SMTP (1L<<16)
#define CURLPROTO_SMTPS (1L<<17)
#define CURLPROTO_RTSP (1L<<18)
#define CURLPROTO_RTMP (1L<<19)
#define CURLPROTO_RTMPT (1L<<20)
#define CURLPROTO_RTMPE (1L<<21)
#define CURLPROTO_RTMPTE (1L<<22)
#define CURLPROTO_RTMPS (1L<<23)
#define CURLPROTO_RTMPTS (1L<<24)
#define CURLPROTO_GOPHER (1L<<25)
#define CURLPROTO_SMB (1L<<26)
#define CURLPROTO_SMBS (1L<<27)
#define CURLPROTO_MQTT (1L<<28)
#define CURLPROTO_GOPHERS (1L<<29)
#define CURLPROTO_HTTP (1L << 0)
#define CURLPROTO_HTTPS (1L << 1)
#define CURLPROTO_FTP (1L << 2)
#define CURLPROTO_FTPS (1L << 3)
#define CURLPROTO_SCP (1L << 4)
#define CURLPROTO_SFTP (1L << 5)
#define CURLPROTO_TELNET (1L << 6)
#define CURLPROTO_LDAP (1L << 7)
#define CURLPROTO_LDAPS (1L << 8)
#define CURLPROTO_DICT (1L << 9)
#define CURLPROTO_FILE (1L << 10)
#define CURLPROTO_TFTP (1L << 11)
#define CURLPROTO_IMAP (1L << 12)
#define CURLPROTO_IMAPS (1L << 13)
#define CURLPROTO_POP3 (1L << 14)
#define CURLPROTO_POP3S (1L << 15)
#define CURLPROTO_SMTP (1L << 16)
#define CURLPROTO_SMTPS (1L << 17)
#define CURLPROTO_RTSP (1L << 18)
#define CURLPROTO_RTMP (1L << 19)
#define CURLPROTO_RTMPT (1L << 20)
#define CURLPROTO_RTMPE (1L << 21)
#define CURLPROTO_RTMPTE (1L << 22)
#define CURLPROTO_RTMPS (1L << 23)
#define CURLPROTO_RTMPTS (1L << 24)
#define CURLPROTO_GOPHER (1L << 25)
#define CURLPROTO_SMB (1L << 26)
#define CURLPROTO_SMBS (1L << 27)
#define CURLPROTO_MQTT (1L << 28)
#define CURLPROTO_GOPHERS (1L << 29)
#define CURLPROTO_ALL (~0L) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
@@ -2424,7 +2424,7 @@ typedef struct curl_mime curl_mime; /* Mime context. */
typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
#define CURLMIMEOPT_FORMESCAPE (1L<<0) /* Use backslash-escaping for forms. */
#define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */
/*
* NAME curl_mime_init()
@@ -3006,12 +3006,12 @@ typedef enum {
CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1)
#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1 << 1)
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
#define CURL_GLOBAL_ACK_EINTR (1<<2)
#define CURL_GLOBAL_ACK_EINTR (1 << 2)
/*****************************************************************************
* Setup defines, protos etc for the sharing stuff.
@@ -3247,10 +3247,10 @@ CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
*/
CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#define CURLPAUSE_RECV (1<<0)
#define CURLPAUSE_RECV (1 << 0)
#define CURLPAUSE_RECV_CONT (0)
#define CURLPAUSE_SEND (1<<2)
#define CURLPAUSE_SEND (1 << 2)
#define CURLPAUSE_SEND_CONT (0)
#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND)

View File

@@ -71,8 +71,8 @@
*/
#define LIBCURL_TIMESTAMP "[unreleased]"
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \
#define CURL_VERSION_BITS(x, y, z) ((x) << 16 | (y) << 8 | (z))
#define CURL_AT_LEAST_VERSION(x, y, z) \
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
#endif /* CURLINC_CURLVER_H */

View File

@@ -38,11 +38,11 @@ struct curl_header {
};
/* 'origin' bits */
#define CURLH_HEADER (1<<0) /* plain server header */
#define CURLH_TRAILER (1<<1) /* trailers */
#define CURLH_CONNECT (1<<2) /* CONNECT headers */
#define CURLH_1XX (1<<3) /* 1xx headers */
#define CURLH_PSEUDO (1<<4) /* pseudo headers */
#define CURLH_HEADER (1 << 0) /* plain server header */
#define CURLH_TRAILER (1 << 1) /* trailers */
#define CURLH_CONNECT (1 << 2) /* CONNECT headers */
#define CURLH_1XX (1 << 3) /* 1xx headers */
#define CURLH_PSEUDO (1 << 4) /* pseudo headers */
typedef enum {
CURLHE_OK,

View File

@@ -412,12 +412,12 @@ typedef enum {
/* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
#define CURLMNWC_CLEAR_CONNS (1L<<0)
#define CURLMNWC_CLEAR_CONNS (1L << 0)
/* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
#define CURLMNWC_CLEAR_DNS (1L<<0)
#define CURLMNWC_CLEAR_DNS (1L << 0)
/*
* Name: curl_multi_setopt()

View File

@@ -44,7 +44,7 @@ typedef enum {
/* "alias" means it is provided for old programs to remain functional,
we prefer another name */
#define CURLOT_FLAG_ALIAS (1<<0)
#define CURLOT_FLAG_ALIAS (1 << 0)
/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
to use for curl_easy_setopt() for the given id */

View File

@@ -81,28 +81,28 @@ typedef enum {
CURLUPART_ZONEID /* added in 7.65.0 */
} CURLUPart;
#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */
#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set,
if the port number matches the
default for the scheme */
#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if
missing */
#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */
#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */
#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */
#define CURLU_URLDECODE (1<<6) /* URL decode on get */
#define CURLU_URLENCODE (1<<7) /* URL encode on set */
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the
scheme is unknown. */
#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */
#define CURLU_PUNYCODE (1<<12) /* get the hostname in punycode */
#define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */
#define CURLU_GET_EMPTY (1<<14) /* allow empty queries and fragments
when extracting the URL or the
components */
#define CURLU_NO_GUESS_SCHEME (1<<15) /* for get, do not accept a guess */
#define CURLU_DEFAULT_PORT (1 << 0) /* return default port number */
#define CURLU_NO_DEFAULT_PORT (1 << 1) /* act as if no port number was set,
if the port number matches the
default for the scheme */
#define CURLU_DEFAULT_SCHEME (1 << 2) /* return default scheme if
missing */
#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
#define CURLU_PATH_AS_IS (1 << 4) /* leave dot sequences */
#define CURLU_DISALLOW_USER (1 << 5) /* no user+password allowed */
#define CURLU_URLDECODE (1 << 6) /* URL decode on get */
#define CURLU_URLENCODE (1 << 7) /* URL encode on set */
#define CURLU_APPENDQUERY (1 << 8) /* append a form style part */
#define CURLU_GUESS_SCHEME (1 << 9) /* legacy curl-style guessing */
#define CURLU_NO_AUTHORITY (1 << 10) /* Allow empty authority when the
scheme is unknown. */
#define CURLU_ALLOW_SPACE (1 << 11) /* Allow spaces in the URL */
#define CURLU_PUNYCODE (1 << 12) /* get the hostname in punycode */
#define CURLU_PUNY2IDN (1 << 13) /* punycode => IDN conversion */
#define CURLU_GET_EMPTY (1 << 14) /* allow empty queries and fragments
when extracting the URL or the
components */
#define CURLU_NO_GUESS_SCHEME (1 << 15) /* for get, do not accept a guess */
typedef struct Curl_URL CURLU;

View File

@@ -37,12 +37,12 @@ struct curl_ws_frame {
};
/* flag bits */
#define CURLWS_TEXT (1<<0)
#define CURLWS_BINARY (1<<1)
#define CURLWS_CONT (1<<2)
#define CURLWS_CLOSE (1<<3)
#define CURLWS_PING (1<<4)
#define CURLWS_OFFSET (1<<5)
#define CURLWS_TEXT (1 << 0)
#define CURLWS_BINARY (1 << 1)
#define CURLWS_CONT (1 << 2)
#define CURLWS_CLOSE (1 << 3)
#define CURLWS_PING (1 << 4)
#define CURLWS_OFFSET (1 << 5)
/*
* NAME curl_ws_recv()
@@ -57,7 +57,7 @@ CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
const struct curl_ws_frame **metap);
/* flags for curl_ws_send() */
#define CURLWS_PONG (1<<6)
#define CURLWS_PONG (1 << 6)
/*
* NAME curl_ws_send()
@@ -86,8 +86,8 @@ CURL_EXTERN CURLcode curl_ws_start_frame(CURL *curl,
curl_off_t frame_len);
/* bits for the CURLOPT_WS_OPTIONS bitmask: */
#define CURLWS_RAW_MODE (1L<<0)
#define CURLWS_NOAUTOPONG (1L<<1)
#define CURLWS_RAW_MODE (1L << 0)
#define CURLWS_NOAUTOPONG (1L << 1)
CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl);

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef __AMIGA__

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef CURLRES_ARES
@@ -872,7 +871,7 @@ static CURLcode async_ares_set_dns_servers(struct Curl_easy *data,
result = CURLE_BAD_FUNCTION_ARGUMENT;
break;
}
#else /* too old c-ares version! */
#else /* c-ares version too old! */
(void)data;
(void)(ares_result);
#endif

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
@@ -40,8 +39,7 @@
#ifdef USE_ARES
#include <ares.h>
#include <ares_version.h> /* really old c-ares did not include this by
itself */
#include <ares_version.h> /* really old c-ares did not include it by itself */
#endif
#include "urldata.h"
@@ -173,7 +171,7 @@ int Curl_ares_perform(ares_channel channel, timediff_t timeout_ms)
return nfds;
}
#endif
#endif /* USE_ARES */
#endif /* CURLRES_ASYNCH */

View File

@@ -21,15 +21,15 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "socketpair.h"
/***********************************************************************
* Only for threaded name resolves builds
**********************************************************************/
#ifdef CURLRES_THREADED
#include "socketpair.h"
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
struct Curl_easy;

View File

@@ -21,8 +21,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "bufq.h"
static bool chunk_is_empty(const struct buf_chunk *chunk)

View File

@@ -21,8 +21,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"
#include "bufref.h"
#include "strdup.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
@@ -788,4 +787,4 @@ CURLcode Curl_cf_h1_proxy_insert_after(struct Curl_cfilter *cf_at,
return result;
}
#endif /* !CURL_DISABLE_PROXY && ! CURL_DISABLE_HTTP */
#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY) && \

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if defined(USE_NGHTTP2) && !defined(CURL_DISABLE_PROXY)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifndef CURL_DISABLE_PROXY

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curlx/timediff.h"
struct bufq;

View File

@@ -22,7 +22,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -24,7 +24,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curlx/timeval.h"
struct connectdata;

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)

View File

@@ -22,7 +22,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -24,7 +24,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curlx/timeval.h"
struct connectdata;

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "curl_endian.h"

View File

@@ -21,8 +21,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifndef CURL_DISABLE_FTP
#include "curl_fnmatch.h"
@@ -356,7 +356,8 @@ int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
return loop((const unsigned char *)pattern,
(const unsigned char *)string, 2);
}
#else
#else /* HAVE_FNMATCH */
#include <fnmatch.h>
/*
* @unittest: 1307
@@ -379,7 +380,6 @@ int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
}
/* not reached */
}
#endif /* !HAVE_FNMATCH */
#endif
#endif /* if FTP is disabled */
#endif /* !CURL_DISABLE_FTP */

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#define CURL_FNMATCH_MATCH 0
#define CURL_FNMATCH_NOMATCH 1
#define CURL_FNMATCH_FAIL 2

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \
@@ -156,4 +155,4 @@ fail:
return result;
}
#endif /* ! disabled */
#endif /* !disabled */

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curlx/fopen.h"
CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curlx/dynbuf.h"
/* Curl_get_line() returns complete lines that end with a newline. */

View File

@@ -21,8 +21,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "curl_gethostname.h"
#include "curlx/strcopy.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_GSSAPI

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "curl_memrchr.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_MEMRCHR

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "curl_range.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -22,7 +22,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_LIBRTMP
@@ -384,4 +383,4 @@ void Curl_rtmp_version(char *version, size_t len)
suff);
}
#endif /* USE_LIBRTMP */
#endif /* USE_LIBRTMP */

View File

@@ -32,7 +32,6 @@
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "bufref.h"
struct Curl_easy;

View File

@@ -24,7 +24,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256)
@@ -75,7 +74,7 @@
# ifdef SHA512_256_DIGEST_SIZE
# define USE_GNUTLS_SHA512_256 1
# endif
#endif /* ! HAS_SHA512_256_IMPLEMENTATION && USE_GNUTLS */
#endif /* !HAS_SHA512_256_IMPLEMENTATION && USE_GNUTLS */
#ifdef USE_OPENSSL_SHA512_256
@@ -169,9 +168,9 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
if(ret == CURLE_OK)
memcpy(digest, tmp_digest, CURL_SHA512_256_DIGEST_SIZE);
explicit_memset(tmp_digest, 0, sizeof(tmp_digest));
#else /* ! NEED_NETBSD_SHA512_256_WORKAROUND */
#else /* !NEED_NETBSD_SHA512_256_WORKAROUND */
ret = EVP_DigestFinal_ex(*ctx, digest, NULL) ? CURLE_OK : CURLE_SSL_CIPHER;
#endif /* ! NEED_NETBSD_SHA512_256_WORKAROUND */
#endif /* NEED_NETBSD_SHA512_256_WORKAROUND */
EVP_MD_CTX_destroy(*ctx);
*ctx = NULL;
@@ -288,15 +287,16 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
((uint64_t)(((const uint8_t *)(ptr))[6]) << 8) | \
(uint64_t)(((const uint8_t *)(ptr))[7]))
#define CURL_PUT_64BIT_BE(ptr,val) do { \
((uint8_t*)(ptr))[7] = (uint8_t) ((uint64_t)(val)); \
((uint8_t*)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \
((uint8_t*)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \
((uint8_t*)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \
((uint8_t*)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \
((uint8_t*)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \
((uint8_t*)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \
((uint8_t*)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \
#define CURL_PUT_64BIT_BE(ptr, val) \
do { \
((uint8_t *)(ptr))[7] = (uint8_t)((uint64_t)(val)); \
((uint8_t *)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \
((uint8_t *)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \
((uint8_t *)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \
((uint8_t *)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \
((uint8_t *)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \
((uint8_t *)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \
((uint8_t *)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \
} while(0)
/* Defined as a function. The macro version may duplicate the binary code
@@ -459,9 +459,9 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
(Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39))
#define SIG1(x) \
(Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41))
#define sig0(x) \
(Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7))
#define sig1(x) \
#define sig0(x) \
(Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7))
#define sig1(x) \
(Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6))
if(1) {
@@ -601,7 +601,7 @@ static CURLcode Curl_sha512_256_update(void *context,
const unsigned char *data,
size_t length)
{
unsigned int bytes_have; /**< Number of bytes in the context buffer */
unsigned int bytes_have; /* Number of bytes in the context buffer */
struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context;
/* the void pointer here is required to mute Intel compiler warning */
void * const ctx_buf = ctx->buffer;
@@ -625,7 +625,7 @@ static CURLcode Curl_sha512_256_update(void *context,
if(length >= bytes_left) {
/* Combine new data with data in the buffer and process the full
block. */
memcpy(((unsigned char *)ctx_buf) + bytes_have, data, bytes_left);
memcpy((unsigned char *)ctx_buf + bytes_have, data, bytes_left);
data += bytes_left;
length -= bytes_left;
Curl_sha512_256_transform(ctx->H, ctx->buffer);
@@ -644,7 +644,7 @@ static CURLcode Curl_sha512_256_update(void *context,
if(length) {
/* Copy incomplete block of new data (if any)
to the buffer. */
memcpy(((unsigned char *)ctx_buf) + bytes_have, data, length);
memcpy((unsigned char *)ctx_buf + bytes_have, data, length);
}
return CURLE_OK;
@@ -672,8 +672,8 @@ static CURLcode Curl_sha512_256_update(void *context,
static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
{
struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context;
uint64_t num_bits; /**< Number of processed bits */
unsigned int bytes_have; /**< Number of bytes in the context buffer */
uint64_t num_bits; /* Number of processed bits */
unsigned int bytes_have; /* Number of bytes in the context buffer */
/* the void pointer here is required to mute Intel compiler warning */
void * const ctx_buf = ctx->buffer;
@@ -702,7 +702,7 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
/* No space in the current block to put the total length of message.
Pad the current block with zeros and process it. */
if(bytes_have < CURL_SHA512_256_BLOCK_SIZE)
memset(((unsigned char *)ctx_buf) + bytes_have, 0,
memset((unsigned char *)ctx_buf + bytes_have, 0,
CURL_SHA512_256_BLOCK_SIZE - bytes_have);
/* Process the full block. */
Curl_sha512_256_transform(ctx->H, ctx->buffer);
@@ -711,31 +711,29 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
}
/* Pad the rest of the buffer with zeros. */
memset(((unsigned char *)ctx_buf) + bytes_have, 0,
memset((unsigned char *)ctx_buf + bytes_have, 0,
CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD - bytes_have);
/* Put high part of number of bits in processed message and then lower
part of number of bits as big-endian values.
See FIPS PUB 180-4 section 5.1.2. */
/* Note: the target location is predefined and buffer is always aligned */
CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \
+ CURL_SHA512_256_BLOCK_SIZE \
- SHA512_256_SIZE_OF_LEN_ADD, \
ctx->count_bits_hi);
CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \
+ CURL_SHA512_256_BLOCK_SIZE \
- SHA512_256_SIZE_OF_LEN_ADD \
+ SHA512_256_BYTES_IN_WORD, \
num_bits);
CURL_PUT_64BIT_BE((unsigned char *)ctx_buf +
CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD,
ctx->count_bits_hi);
CURL_PUT_64BIT_BE((unsigned char *)ctx_buf +
CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD +
SHA512_256_BYTES_IN_WORD,
num_bits);
/* Process the full final block. */
Curl_sha512_256_transform(ctx->H, ctx->buffer);
/* Put in BE mode the leftmost part of the hash as the final digest.
See FIPS PUB 180-4 section 6.7. */
CURL_PUT_64BIT_BE((digest + 0 * SHA512_256_BYTES_IN_WORD), ctx->H[0]);
CURL_PUT_64BIT_BE((digest + 1 * SHA512_256_BYTES_IN_WORD), ctx->H[1]);
CURL_PUT_64BIT_BE((digest + 2 * SHA512_256_BYTES_IN_WORD), ctx->H[2]);
CURL_PUT_64BIT_BE((digest + 3 * SHA512_256_BYTES_IN_WORD), ctx->H[3]);
CURL_PUT_64BIT_BE(digest + 0 * SHA512_256_BYTES_IN_WORD, ctx->H[0]);
CURL_PUT_64BIT_BE(digest + 1 * SHA512_256_BYTES_IN_WORD, ctx->H[1]);
CURL_PUT_64BIT_BE(digest + 2 * SHA512_256_BYTES_IN_WORD, ctx->H[2]);
CURL_PUT_64BIT_BE(digest + 3 * SHA512_256_BYTES_IN_WORD, ctx->H[3]);
/* Erase potentially sensitive data. */
memset(ctx, 0, sizeof(struct Curl_sha512_256ctx));

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"
@@ -93,7 +92,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
if(!share->cookies)
res = CURLSHE_NOMEM;
}
#else /* CURL_DISABLE_HTTP */
#else /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
@@ -105,7 +104,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
if(!share->hsts)
res = CURLSHE_NOMEM;
}
#else /* CURL_DISABLE_HSTS */
#else /* CURL_DISABLE_HSTS */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
@@ -160,7 +159,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
Curl_cookie_cleanup(share->cookies);
share->cookies = NULL;
}
#else /* CURL_DISABLE_HTTP */
#else /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
@@ -170,7 +169,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
if(share->hsts) {
Curl_hsts_cleanup(&share->hsts);
}
#else /* CURL_DISABLE_HSTS */
#else /* CURL_DISABLE_HSTS */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "cookie.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "curl_trc.h"
@@ -86,8 +85,8 @@ static struct curl_trc_feat Curl_trc_feat_ids = {
CURL_LOG_LVL_NONE,
};
#define CURL_TRC_IDS(data) \
(Curl_trc_is_verbose(data) && \
Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
(Curl_trc_is_verbose(data) && \
Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
static size_t trc_print_ids(struct Curl_easy *data, char *buf, size_t maxlen)
{

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
struct Curl_easy;
struct Curl_cfilter;
@@ -119,7 +118,7 @@ void Curl_trc_ssls(struct Curl_easy *data,
#ifdef USE_SSH
extern struct curl_trc_feat Curl_trc_feat_ssh;
void Curl_trc_ssh(struct Curl_easy *data,
const char *fmt, ...) CURL_PRINTF(2, 3);
const char *fmt, ...) CURL_PRINTF(2, 3);
#endif
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
extern struct curl_trc_feat Curl_trc_feat_ws;
@@ -135,52 +134,76 @@ void Curl_trc_ws(struct Curl_easy *data,
Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
#if defined(CURL_HAVE_C99) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
#define infof(data, ...) \
do { if(Curl_trc_is_verbose(data)) \
Curl_infof(data, __VA_ARGS__); } while(0)
#define CURL_TRC_M(data, ...) \
do { if(CURL_TRC_M_is_verbose(data)) \
Curl_trc_multi(data, __VA_ARGS__); } while(0)
#define CURL_TRC_CF(data, cf, ...) \
do { if(Curl_trc_cf_is_verbose(cf, data)) \
Curl_trc_cf_infof(data, cf, __VA_ARGS__); } while(0)
#define CURL_TRC_WRITE(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
Curl_trc_write(data, __VA_ARGS__); } while(0)
#define CURL_TRC_READ(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
Curl_trc_read(data, __VA_ARGS__); } while(0)
#define CURL_TRC_DNS(data, ...) \
do { if(CURL_TRC_DNS_is_verbose(data)) \
Curl_trc_dns(data, __VA_ARGS__); } while(0)
#define CURL_TRC_TIMER(data, tid, ...) \
do { if(CURL_TRC_TIMER_is_verbose(data)) \
Curl_trc_timer(data, tid, __VA_ARGS__); } while(0)
#define infof(data, ...) \
do { \
if(Curl_trc_is_verbose(data)) \
Curl_infof(data, __VA_ARGS__); \
} while(0)
#define CURL_TRC_M(data, ...) \
do { \
if(CURL_TRC_M_is_verbose(data)) \
Curl_trc_multi(data, __VA_ARGS__); \
} while(0)
#define CURL_TRC_CF(data, cf, ...) \
do { \
if(Curl_trc_cf_is_verbose(cf, data)) \
Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
} while(0)
#define CURL_TRC_WRITE(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
Curl_trc_write(data, __VA_ARGS__); \
} while(0)
#define CURL_TRC_READ(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
Curl_trc_read(data, __VA_ARGS__); \
} while(0)
#define CURL_TRC_DNS(data, ...) \
do { \
if(CURL_TRC_DNS_is_verbose(data)) \
Curl_trc_dns(data, __VA_ARGS__); \
} while(0)
#define CURL_TRC_TIMER(data, tid, ...) \
do { \
if(CURL_TRC_TIMER_is_verbose(data)) \
Curl_trc_timer(data, tid, __VA_ARGS__); \
} while(0)
#ifndef CURL_DISABLE_FTP
#define CURL_TRC_FTP(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
Curl_trc_ftp(data, __VA_ARGS__); } while(0)
#define CURL_TRC_FTP(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
Curl_trc_ftp(data, __VA_ARGS__); \
} while(0)
#endif /* !CURL_DISABLE_FTP */
#ifndef CURL_DISABLE_SMTP
#define CURL_TRC_SMTP(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \
Curl_trc_smtp(data, __VA_ARGS__); } while(0)
#define CURL_TRC_SMTP(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \
Curl_trc_smtp(data, __VA_ARGS__); \
} while(0)
#endif /* !CURL_DISABLE_SMTP */
#ifdef USE_SSL
#define CURL_TRC_SSLS(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
Curl_trc_ssls(data, __VA_ARGS__); } while(0)
#define CURL_TRC_SSLS(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
Curl_trc_ssls(data, __VA_ARGS__); \
} while(0)
#endif /* USE_SSL */
#ifdef USE_SSH
#define CURL_TRC_SSH(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \
Curl_trc_ssh(data, __VA_ARGS__); } while(0)
#define CURL_TRC_SSH(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \
Curl_trc_ssh(data, __VA_ARGS__); \
} while(0)
#endif /* USE_SSH */
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
#define CURL_TRC_WS(data, ...) \
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \
Curl_trc_ws(data, __VA_ARGS__); } while(0)
#define CURL_TRC_WS(data, ...) \
do { \
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \
Curl_trc_ws(data, __VA_ARGS__); \
} while(0)
#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */
#else /* CURL_HAVE_C99 */
@@ -220,20 +243,22 @@ extern struct curl_trc_feat Curl_trc_feat_write;
extern struct curl_trc_feat Curl_trc_feat_dns;
extern struct curl_trc_feat Curl_trc_feat_timer;
#define Curl_trc_is_verbose(data) \
((data) && (data)->set.verbose && \
(!(data)->state.feat || \
((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
#define Curl_trc_cf_is_verbose(cf, data) \
(Curl_trc_is_verbose(data) && \
(cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
#define Curl_trc_is_verbose(data) \
((data) && (data)->set.verbose && \
(!(data)->state.feat || \
((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
#define Curl_trc_cf_is_verbose(cf, data) \
(Curl_trc_is_verbose(data) && \
(cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
#define Curl_trc_ft_is_verbose(data, ft) \
(Curl_trc_is_verbose(data) && \
(ft)->log_level >= CURL_LOG_LVL_INFO)
(Curl_trc_is_verbose(data) && \
(ft)->log_level >= CURL_LOG_LVL_INFO)
#define CURL_MSTATE_NAME(s) Curl_trc_mstate_name((int)(s))
#define CURL_TRC_EASY_TIMERS(data) \
do { if(CURL_TRC_TIMER_is_verbose(data)) \
Curl_trc_easy_timers(data); } while(0)
#define CURL_TRC_EASY_TIMERS(data) \
do { \
if(CURL_TRC_TIMER_is_verbose(data)) \
Curl_trc_easy_timers(data); \
} while(0)
#else /* CURL_DISABLE_VERBOSE_STRINGS */
/* All informational messages are not compiled in for size savings */

View File

@@ -21,8 +21,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#include "dynbuf.h"
#include "../curl_printf.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#include "fopen.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#include "multibyte.h"

View File

@@ -16,7 +16,6 @@
*
* SPDX-License-Identifier: ISC
*/
#include "../curl_setup.h"
#ifndef HAVE_INET_NTOP

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef HAVE_INET_NTOP

View File

@@ -17,7 +17,6 @@
*
* SPDX-License-Identifier: ISC
*/
#include "../curl_setup.h"
#include "strparse.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef HAVE_INET_PTON

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#if defined(_WIN32) && defined(UNICODE)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef HAVE_SYS_IOCTL_H

View File

@@ -22,6 +22,7 @@
*
***************************************************************************/
#include "../curl_setup.h"
#include "strcopy.h"
/*

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef HAVE_STRERROR_R

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "strparse.h"
void curlx_str_init(struct Curl_str *out)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "timediff.h"
/*

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
/* Use a larger type even for 32-bit time_t systems so that we can keep

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "timeval.h"
#ifdef _WIN32

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#include "timediff.h"

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef _WIN32

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifdef _WIN32

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#ifndef HAVE_SELECT

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
int curlx_wait_ms(timediff_t timeout_ms);

View File

@@ -21,6 +21,7 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "../curl_setup.h"
#include "warnless.h"

View File

@@ -24,8 +24,6 @@
*
***************************************************************************/
#include "../curl_setup.h"
#define CURLX_FUNCTION_CAST(target_type, func) \
(target_type)(void (*)(void))(func)

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
struct Curl_easy;

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#include "urldata.h"

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
struct Curl_easy;

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifndef CURL_DISABLE_DICT

View File

@@ -23,7 +23,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#ifndef CURL_DISABLE_DICT
extern const struct Curl_handler Curl_handler_dict;
#endif

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_OPENSSL
@@ -60,6 +59,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
return TRUE;
}
#endif /* OpenSSL */
#endif /* USE_OPENSSL (non-fork) */
#endif /* DLL build */
#endif /* _WIN32 && !CURL_STATICLIB */

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifndef CURL_DISABLE_DOH

Some files were not shown because too many files have changed in this diff Show More