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
sscanf
stat
strcat
+ strcpy
strdup
strerror
strncat
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;
}
~~~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);
~~~
~~~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);
~~~
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'));
}
}
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
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 {
*/
#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 */
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
/* 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;
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
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()
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.
*/
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)
*/
#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 */
};
/* '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,
/* - 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()
/* "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 */
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;
};
/* 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()
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()
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);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef __AMIGA__
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef CURLRES_ARES
result = CURLE_BAD_FUNCTION_ARGUMENT;
break;
}
-#else /* too old c-ares version! */
+#else /* c-ares version too old! */
(void)data;
(void)(ares_result);
#endif
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
#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"
return nfds;
}
-#endif
+#endif /* USE_ARES */
#endif /* CURLRES_ASYNCH */
* 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
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
+
#include "bufq.h"
static bool chunk_is_empty(const struct buf_chunk *chunk)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
+
#include "urldata.h"
#include "bufref.h"
#include "strdup.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
return result;
}
-#endif /* !CURL_DISABLE_PROXY && ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY) && \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if defined(USE_NGHTTP2) && !defined(CURL_DISABLE_PROXY)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_PROXY
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/timediff.h"
struct bufq;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/timeval.h"
struct connectdata;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/timeval.h"
struct connectdata;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curl_endian.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
+
#ifndef CURL_DISABLE_FTP
#include "curl_fnmatch.h"
return loop((const unsigned char *)pattern,
(const unsigned char *)string, 2);
}
-#else
+#else /* HAVE_FNMATCH */
+
#include <fnmatch.h>
/*
* @unittest: 1307
}
/* not reached */
}
+#endif /* !HAVE_FNMATCH */
-#endif
-
-#endif /* if FTP is disabled */
+#endif /* !CURL_DISABLE_FTP */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#define CURL_FNMATCH_MATCH 0
#define CURL_FNMATCH_NOMATCH 1
#define CURL_FNMATCH_FAIL 2
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \
return result;
}
-#endif /* ! disabled */
+#endif /* !disabled */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/fopen.h"
CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/dynbuf.h"
/* Curl_get_line() returns complete lines that end with a newline. */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
+
#include "curl_gethostname.h"
#include "curlx/strcopy.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_GSSAPI
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curl_memrchr.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_MEMRCHR
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curl_range.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_LIBRTMP
suff);
}
-#endif /* USE_LIBRTMP */
+#endif /* USE_LIBRTMP */
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "bufref.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256)
# 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
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;
((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
(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) {
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;
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);
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;
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;
/* 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);
}
/* 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));
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
if(!share->cookies)
res = CURLSHE_NOMEM;
}
-#else /* CURL_DISABLE_HTTP */
+#else /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
if(!share->hsts)
res = CURLSHE_NOMEM;
}
-#else /* CURL_DISABLE_HSTS */
+#else /* CURL_DISABLE_HSTS */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
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;
if(share->hsts) {
Curl_hsts_cleanup(&share->hsts);
}
-#else /* CURL_DISABLE_HSTS */
+#else /* CURL_DISABLE_HSTS */
res = CURLSHE_NOT_BUILT_IN;
#endif
break;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "cookie.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curl_trc.h"
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)
{
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
struct Curl_easy;
struct Curl_cfilter;
#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;
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 */
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 */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
+
#include "dynbuf.h"
#include "../curl_printf.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "fopen.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "multibyte.h"
*
* SPDX-License-Identifier: ISC
*/
-
#include "../curl_setup.h"
#ifndef HAVE_INET_NTOP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef HAVE_INET_NTOP
*
* SPDX-License-Identifier: ISC
*/
-
#include "../curl_setup.h"
#include "strparse.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef HAVE_INET_PTON
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(_WIN32) && defined(UNICODE)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef HAVE_SYS_IOCTL_H
*
***************************************************************************/
#include "../curl_setup.h"
+
#include "strcopy.h"
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef HAVE_STRERROR_R
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "strparse.h"
void curlx_str_init(struct Curl_str *out)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "timediff.h"
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
/* Use a larger type even for 32-bit time_t systems so that we can keep
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "timeval.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "timediff.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifndef HAVE_SELECT
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
int curlx_wait_ms(timediff_t timeout_ms);
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "../curl_setup.h"
#include "warnless.h"
*
***************************************************************************/
-#include "../curl_setup.h"
-
#define CURLX_FUNCTION_CAST(target_type, func) \
(target_type)(void (*)(void))(func)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_DICT
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifndef CURL_DISABLE_DICT
extern const struct Curl_handler Curl_handler_dict;
#endif
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_OPENSSL
}
return TRUE;
}
-#endif /* OpenSSL */
+#endif /* USE_OPENSSL (non-fork) */
-#endif /* DLL build */
+#endif /* _WIN32 && !CURL_STATICLIB */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_DOH
UNITTEST void de_cleanup(struct dohentry *d);
#endif
-#else /* if DoH is disabled */
+#else /* CURL_DISABLE_DOH */
#define Curl_doh(a, b, c, d, e) NULL
#define Curl_doh_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST
-#endif
+#endif /* !CURL_DISABLE_DOH */
#endif /* HEADER_CURL_DOH_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "dynhds.h"
#include <nghttp2/nghttp2.h>
#endif /* USE_NGHTTP2 */
-
-static struct dynhds_entry *
-entry_new(const char *name, size_t namelen,
- const char *value, size_t valuelen, int opts)
+static struct dynhds_entry *entry_new(const char *name, size_t namelen,
+ const char *value, size_t valuelen,
+ int opts)
{
struct dynhds_entry *e;
char *p;
e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2);
if(!e)
return NULL;
- e->name = p = ((char *)e) + sizeof(*e);
+ e->name = p = (char *)e + sizeof(*e);
memcpy(p, name, namelen);
e->namelen = namelen;
e->value = p += namelen + 1; /* leave a \0 at the end of name */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#define GLOBAL_INIT_IS_THREADSAFE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "easyoptions.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Prototypes for library-wide functions provided by easy.c
*/
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* should probably go into the public header */
/* generated table with all easy options */
#ifdef DEBUGBUILD
int Curl_easyopts_check(void);
#endif
-#endif
+
+#endif /* HEADER_CURL_EASYOPTIONS_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */
-
#include "curl_setup.h"
struct Curl_easy;
if(!length)
return curlx_strdup("");
- if(length > SIZE_MAX/16)
+ if(length > SIZE_MAX / 16)
return NULL;
curlx_dyn_init(&d, length * 3 + 1);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "fake_addrinfo.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_ARES
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_FILE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifndef CURL_DISABLE_FILE
extern const struct Curl_handler Curl_handler_file;
#endif
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_FTP
curlx_free(finfo);
}
-#endif
+#endif /* !CURL_DISABLE_FTP */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "llist.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_FORM_API
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_FTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "pingpong.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "curl_setup.h"
+
+#ifndef CURL_DISABLE_FTP
/**
* Now implemented:
* 01-29-97 11:32PM <DIR> prog
*/
-#include "curl_setup.h"
-
-#ifndef CURL_DISABLE_FTP
-
#include "urldata.h"
#include "fileinfo.h"
#include "llist.h"
return retsize;
}
-#endif /* CURL_DISABLE_FTP */
+#endif /* !CURL_DISABLE_FTP */
struct Curl_easy;
-#else
-/* FTP is disabled */
+#else /* CURL_DISABLE_FTP */
#define Curl_wildcard_dtor(x)
-#endif /* CURL_DISABLE_FTP */
+#endif /* !CURL_DISABLE_FTP */
+
#endif /* HEADER_CURL_FTPLISTPARSER_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/* defaults:
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
char *curl_getenv(const char *variable)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_GOPHER
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifndef CURL_DISABLE_GOPHER
extern const struct Curl_handler Curl_handler_gopher;
#ifdef USE_SSL
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "hash.h"
#define ITERINIT 0x5FEDCBA9
#endif
-
#if 0 /* useful function for debugging hashes and their contents */
void Curl_hash_print(struct Curl_hash *h, void (*func)(void *))
{
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/* Hash function prototype */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* RFC2104 Keyed-Hashing for Message Authentication
*
***************************************************************************/
-
#include "curl_setup.h"
#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "hash.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/***********************************************************************
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/***********************************************************************
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_NGHTTP2
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_AWS)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_HTTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "http_proxy.h"
return result;
}
-#endif /* ! CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */
+#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_HTTPSRR
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_ARES
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* IDN conversions
*/
-
#include "curl_setup.h"
#include "urldata.h"
#define IDN2_LOOKUP(name, host, flags) \
idn2_lookup_ul((const char *)name, (char **)host, flags)
#endif
-#endif /* USE_LIBIDN2 */
+#endif /* USE_LIBIDN2 */
/* for macOS and iOS targets */
#ifdef USE_APPLE_IDN
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
bool Curl_is_ASCII_name(const char *hostname);
CURLcode Curl_idnconvert_hostname(struct hostname *host);
+
#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN)
#define USE_IDN
void Curl_free_idnconverted_hostname(struct hostname *host);
CURLcode Curl_idn_decode(const char *input, char **output);
CURLcode Curl_idn_encode(const char *input, char **output);
-
#else
#define Curl_free_idnconverted_hostname(x)
#define Curl_idn_decode(x) NULL
#endif
+
#endif /* HEADER_CURL_IDN_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
extern const struct Curl_handler Curl_handler_imap;
extern const struct Curl_handler Curl_handler_imaps;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "llist.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
typedef void (*Curl_llist_dtor)(void *user, void *elem);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef CURL_MACOS_CALL_COPYPROXIES
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef CURL_MACOS_CALL_COPYPROXIES
-
CURLcode Curl_macos_init(void);
-
#else
-
#define Curl_macos_init() CURLE_OK
-
#endif
#endif /* HEADER_CURL_MACOS_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_CURL_NTLM_CORE
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef CURLDEBUG
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#define MIME_BOUNDARY_DASHES 24 /* leading boundary dashes */
*
* SPDX-License-Identifier: curl
*
- */
-
+ ***************************************************************************/
#include "curl_setup.h"
#include "curlx/dynbuf.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_MQTT
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifndef CURL_DISABLE_MQTT
extern const struct Curl_handler Curl_handler_mqtt;
#endif
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "hash.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "uint-bset.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "llist.h"
#include "hash.h"
#include "conncache.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Prototypes for library-wide functions provided by multi.c
*/
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_NETRC
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_NETRC
+
#include "curlx/dynbuf.h"
struct store_netrc {
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_PROXY
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "curl_setup.h"
+
+#include "parsedate.h"
+#include "curlx/strparse.h"
+
/*
A brief summary of the date string formats this parser groks:
*/
-#include "curl_setup.h"
-
-#include "parsedate.h"
-#include "curlx/strparse.h"
-
/*
* parsedate()
*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
extern const char * const Curl_wkday[7];
extern const char * const Curl_month[12];
* IMAP, POP3, SMTP and whatever more that likes them.
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_FTP) || \
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
extern const struct Curl_handler Curl_handler_pop3;
extern const struct Curl_handler Curl_handler_pop3s;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/timeval.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_LIBPSL
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifdef USE_LIBPSL
+
#include <libpsl.h>
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_ARPA_INET_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
CURLcode Curl_rand_bytes(struct Curl_easy *data,
#ifdef DEBUGBUILD
bool allow_env_override,
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curlx/timeval.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curlx/timeval.h"
struct Curl_easy;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* This file is for lib internal stuff */
-
#include "curl_setup.h"
#include "bufq.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_RTSP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#ifndef CURL_DISABLE_RTSP
-
extern const struct Curl_handler Curl_handler_rtsp;
-
CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header);
-
#else
-/* disabled */
#define Curl_rtsp_parseheader(x, y) CURLE_NOT_BUILT_IN
-
-#endif /* CURL_DISABLE_RTSP */
+#endif
#endif /* HEADER_CURL_RTSP_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(HAVE_SELECT) && !defined(HAVE_POLL)
ufds[i].revents |= POLLIN | POLLOUT;
}
-#else /* HAVE_POLL */
+#else /* !HAVE_POLL */
FD_ZERO(&fds_read);
FD_ZERO(&fds_write);
r++;
}
-#endif /* HAVE_POLL */
+#endif /* HAVE_POLL */
return r;
}
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_POLL_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/**
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
data->set.httpwant = (unsigned char)arg;
return CURLE_OK;
}
-#endif /* ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_HTTP */
#ifdef USE_SSL
CURLcode Curl_setopt_SSLVERSION(struct Curl_easy *data, CURLoption option,
}
return CURLE_OK;
}
-#endif /* ! USE_SSL */
+#endif /* !USE_SSL */
#ifndef CURL_DISABLE_RTSP
static CURLcode setopt_RTSP_REQUEST(struct Curl_easy *data, long arg)
data->set.rtspreq = rtspreq;
return CURLE_OK;
}
-#endif /* ! CURL_DISABLE_RTSP */
+#endif /* !CURL_DISABLE_RTSP */
#ifdef USE_SSL
static void set_ssl_options(struct ssl_config_data *ssl,
else
s->method = HTTPREQ_GET;
break;
-#endif /* ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_HTTP */
#ifndef CURL_DISABLE_PROXY
case CURLOPT_HTTPPROXYTUNNEL:
/*
*/
s->proxy_transfer_mode = enabled;
break;
-#endif /* ! CURL_DISABLE_PROXY */
+#endif /* !CURL_DISABLE_PROXY */
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
case CURLOPT_SOCKS5_GSSAPI_NEC:
/*
*/
s->tftp_no_options = enabled;
break;
-#endif /* ! CURL_DISABLE_TFTP */
+#endif /* !CURL_DISABLE_TFTP */
case CURLOPT_TRANSFERTEXT:
/*
* This option was previously named 'FTPASCII'. Renamed to work with
s->doh_verifystatus = enabled;
ok = 2;
break;
-#endif /* ! CURL_DISABLE_DOH */
+#endif /* !CURL_DISABLE_DOH */
case CURLOPT_SSL_VERIFYHOST:
/*
* Enable verification of the hostname in the peer certificate
case CURLOPT_SSH_COMPRESSION:
s->ssh_compression = enabled;
break;
-#endif /* ! USE_SSH */
+#endif /* !USE_SSH */
#ifndef CURL_DISABLE_SMTP
case CURLOPT_MAIL_RCPT_ALLOWFAILS:
/* allow RCPT TO command to fail for some recipients */
s->expect_100_timeout = (unsigned short)arg;
break;
-#endif /* ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_HTTP */
#ifndef CURL_DISABLE_MIME
case CURLOPT_MIME_OPTIONS:
return CURLE_NOT_BUILT_IN;
s->socks5auth = (unsigned char)uarg;
break;
-#endif /* ! CURL_DISABLE_PROXY */
+#endif /* !CURL_DISABLE_PROXY */
#ifndef CURL_DISABLE_FTP
case CURLOPT_FTP_FILEMETHOD:
break;
case CURLOPT_ACCEPTTIMEOUT_MS:
return setopt_set_timeout_ms(&s->accepttimeout, arg);
-#endif /* ! CURL_DISABLE_FTP */
+#endif /* !CURL_DISABLE_FTP */
#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
case CURLOPT_FTP_CREATE_MISSING_DIRS:
if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY))
return CURLE_BAD_FUNCTION_ARGUMENT;
s->ftp_create_missing_dirs = (unsigned char)arg;
break;
-#endif /* ! CURL_DISABLE_FTP || USE_SSH */
+#endif /* !CURL_DISABLE_FTP || USE_SSH */
case CURLOPT_INFILESIZE:
if(arg < -1)
return CURLE_BAD_FUNCTION_ARGUMENT;
data->state.rtsp_next_server_CSeq = arg;
break;
-#endif /* ! CURL_DISABLE_RTSP */
+#endif /* !CURL_DISABLE_RTSP */
case CURLOPT_TCP_KEEPIDLE:
result = value_range(&arg, 0, 0, INT_MAX);
else
Curl_hsts_cleanup(&data->hsts);
break;
-#endif /* ! CURL_DISABLE_HSTS */
+#endif /* !CURL_DISABLE_HSTS */
#ifndef CURL_DISABLE_ALTSVC
case CURLOPT_ALTSVC_CTRL:
if(!arg) {
return CURLE_OUT_OF_MEMORY;
}
return Curl_altsvc_ctrl(data->asi, arg);
-#endif /* ! CURL_DISABLE_ALTSVC */
+#endif /* !CURL_DISABLE_ALTSVC */
#ifndef CURL_DISABLE_WEBSOCKETS
case CURLOPT_WS_OPTIONS:
s->ws_raw_mode = (bool)(arg & CURLWS_RAW_MODE);
Curl_safefree(data->state.formp);
data->state.mimepost = NULL;
break;
-#endif /* ! CURL_DISABLE_FORM_API */
-#endif /* ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_FORM_API */
+#endif /* !CURL_DISABLE_HTTP */
#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \
!defined(CURL_DISABLE_IMAP)
# ifndef CURL_DISABLE_MIME
#endif
}
break;
-#endif /* ! CURL_DISABLE_MIME */
-#endif /* ! disabled HTTP, SMTP or IMAP */
+#endif /* !CURL_DISABLE_MIME */
+#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
case CURLOPT_STDERR:
/*
* Set to a FILE * that should receive all error writes. This
Curl_safefree(s->str[STRING_COPYPOSTFIELDS]);
s->method = HTTPREQ_POST;
break;
-#endif /* ! CURL_DISABLE_HTTP || ! CURL_DISABLE_MQTT */
+#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_MQTT */
#ifndef CURL_DISABLE_HTTP
case CURLOPT_ACCEPT_ENCODING:
return cookielist(data, ptr);
#endif /* !CURL_DISABLE_COOKIES */
-#endif /* ! CURL_DISABLE_HTTP */
+#endif /* !CURL_DISABLE_HTTP */
case CURLOPT_CUSTOMREQUEST:
/*
* proxy exception list
*/
return Curl_setstropt(&s->str[STRING_NOPROXY], ptr);
-#endif /* ! CURL_DISABLE_PROXY */
+#endif /* !CURL_DISABLE_PROXY */
case CURLOPT_RANGE:
/*
case CURLOPT_INTERLEAVEDATA:
s->rtp_out = ptr;
break;
-#endif /* ! CURL_DISABLE_RTSP */
+#endif /* !CURL_DISABLE_RTSP */
#ifndef CURL_DISABLE_FTP
case CURLOPT_CHUNK_DATA:
s->wildcardptr = ptr;
}
break;
}
-#endif /* ! CURL_DISABLE_HSTS */
+#endif /* !CURL_DISABLE_HSTS */
#ifndef CURL_DISABLE_ALTSVC
case CURLOPT_ALTSVC:
if(!data->asi) {
if(ptr)
return Curl_altsvc_load(data->asi, ptr);
break;
-#endif /* ! CURL_DISABLE_ALTSVC */
+#endif /* !CURL_DISABLE_ALTSVC */
#ifdef USE_ECH
case CURLOPT_ECH: {
size_t plen = 0;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "slist.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE)
next_state = SMB_CLOSE;
break;
}
- len = Curl_read16_le(((const unsigned char *)msg) +
+ len = Curl_read16_le((const unsigned char *)msg +
sizeof(struct smb_header) + 11);
- off = Curl_read16_le(((const unsigned char *)msg) +
+ off = Curl_read16_le((const unsigned char *)msg +
sizeof(struct smb_header) + 13);
if(len > 0) {
if(off + sizeof(unsigned int) + len > smbc->got) {
next_state = SMB_CLOSE;
break;
}
- len = Curl_read16_le(((const unsigned char *)msg) +
+ len = Curl_read16_le((const unsigned char *)msg +
sizeof(struct smb_header) + 5);
data->req.bytecount += len;
data->req.offset += len;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \
(SIZEOF_CURL_OFF_T > 4)
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_SMTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
extern const struct Curl_handler Curl_handler_smtp;
extern const struct Curl_handler Curl_handler_smtps;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
struct Curl_sockaddr_storage {
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "socketpair.h"
goto error;
if(
#ifdef USE_WINSOCK
- /* This is how Windows does it */
- (SOCKEWOULDBLOCK == sockerr)
+ /* This is how Windows does it */
+ (SOCKEWOULDBLOCK == sockerr)
#else
- /* errno may be EWOULDBLOCK or on some systems EAGAIN when it
- returned due to its inability to send off data without
- blocking. We therefore treat both error codes the same here */
- (SOCKEWOULDBLOCK == sockerr) || (EAGAIN == sockerr) ||
- (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr)
+ /* errno may be EWOULDBLOCK or on some systems EAGAIN when it
+ returned due to its inability to send off data without
+ blocking. We therefore treat both error codes the same here */
+ (SOCKEWOULDBLOCK == sockerr) || (EAGAIN == sockerr) ||
+ (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr)
#endif
) {
continue;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_EVENTFD
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_PROXY
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_PROXY
#endif /* !CURL_DISABLE_PROXY */
-#endif /* HEADER_CURL_SOCKS_H */
+#endif /* HEADER_CURL_SOCKS_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if defined(HAVE_GSSAPI) && !defined(CURL_DISABLE_PROXY)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_PROXY)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "curlx/timeval.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "strcase.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
char Curl_raw_toupper(char in);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "strcase.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef _WIN32
/* This is used instead of if_nametoindex if available on Windows */
extern IF_NAMETOINDEX_FN Curl_if_nametoindex;
#endif
-#else /* _WIN32 */
+#else /* !_WIN32 */
#define Curl_win32_init(x) CURLE_OK
-#endif /* !_WIN32 */
+#endif /* _WIN32 */
#endif /* HEADER_CURL_SYSTEM_WIN32_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_TELNET
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifndef CURL_DISABLE_TFTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
char *Curl_checkheaders(const struct Curl_easy *data,
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "uint-bset.h"
x -= (x >> 1) & m1; /* replace every 2 bits with bits present */
x = (x & m2) + ((x >> 2) & m2); /* replace every nibble with bits present */
x = (x + (x >> 4)) & m4; /* replace every byte with bits present */
- /* top 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... which makes the
+ /* top 8 bits of x + (x << 8) + (x << 16) + (x << 24) + ... which makes the
* top byte the sum of all individual 8 bytes, throw away the rest */
return (uint32_t)((x * h01) >> 56);
}
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "uint-hash.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
/* A version with uint32_t as key */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "uint-bset.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "uint-table.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef HAVE_NETINET_IN_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#include "urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* This file is for lib internal stuff */
-
#include "curl_setup.h"
#define PORT_FTP 21
};
#define PROTOPT_NONE 0 /* nothing extra */
-#define PROTOPT_SSL (1<<0) /* uses SSL */
-#define PROTOPT_DUAL (1<<1) /* this protocol uses two connections */
-#define PROTOPT_CLOSEACTION (1<<2) /* need action before socket close */
+#define PROTOPT_SSL (1 << 0) /* uses SSL */
+#define PROTOPT_DUAL (1 << 1) /* this protocol uses two connections */
+#define PROTOPT_CLOSEACTION (1 << 2) /* need action before socket close */
/* some protocols will have to call the underlying functions without regard to
what exact state the socket signals. IE even if the socket says "readable",
the send function might need to be called while uploading, or vice versa.
*/
-#define PROTOPT_DIRLOCK (1<<3)
-#define PROTOPT_NONETWORK (1<<4) /* protocol does not use the network! */
-#define PROTOPT_NEEDSPWD (1<<5) /* needs a password, and if none is set it
+#define PROTOPT_DIRLOCK (1 << 3)
+#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
+#define PROTOPT_NEEDSPWD (1 << 5) /* needs a password, and if none is set it
gets a default */
-#define PROTOPT_NOURLQUERY (1<<6) /* protocol cannot handle
- URL query strings (?foo=bar) ! */
-#define PROTOPT_CREDSPERREQUEST (1<<7) /* requires login credentials per
- request instead of per connection */
-#define PROTOPT_ALPN (1<<8) /* set ALPN for this */
-/* (1<<9) was PROTOPT_STREAM, now free */
-#define PROTOPT_URLOPTIONS (1<<10) /* allow options part in the userinfo field
- of the URL */
-#define PROTOPT_PROXY_AS_HTTP (1<<11) /* allow this non-HTTP scheme over a
- HTTP proxy as HTTP proxies may know
- this protocol and act as a gateway */
-#define PROTOPT_WILDCARD (1<<12) /* protocol supports wildcard matching */
-#define PROTOPT_USERPWDCTRL (1<<13) /* Allow "control bytes" (< 32 ASCII) in
- username and password */
-#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol cannot proxy over TCP */
-#define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing
- SSL connection in the same family
- without having PROTOPT_SSL. */
-#define PROTOPT_CONN_REUSE (1<<16) /* this protocol can reuse connections */
+#define PROTOPT_NOURLQUERY (1 << 6) /* protocol cannot handle
+ URL query strings (?foo=bar) ! */
+#define PROTOPT_CREDSPERREQUEST (1 << 7) /* requires login credentials per
+ request instead of per
+ connection */
+#define PROTOPT_ALPN (1 << 8) /* set ALPN for this */
+/* (1 << 9) was PROTOPT_STREAM, now free */
+#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
+ field of the URL */
+#define PROTOPT_PROXY_AS_HTTP (1 << 11) /* allow this non-HTTP scheme over a
+ HTTP proxy as HTTP proxies may know
+ this protocol and act as
+ a gateway */
+#define PROTOPT_WILDCARD (1 << 12) /* protocol supports wildcard matching */
+#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
+ username and password */
+#define PROTOPT_NOTCPPROXY (1 << 14) /* this protocol cannot proxy over TCP */
+#define PROTOPT_SSL_REUSE (1 << 15) /* this protocol may reuse an existing
+ SSL connection in the same family
+ without having PROTOPT_SSL. */
+#define PROTOPT_CONN_REUSE (1 << 16) /* this protocol can reuse connections */
#define CONNCHECK_NONE 0 /* No checks */
-#define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */
-#define CONNCHECK_KEEPALIVE (1<<1) /* Perform any keepalive function. */
+#define CONNCHECK_ISDEAD (1 << 0) /* Check if the connection is dead. */
+#define CONNCHECK_KEEPALIVE (1 << 1) /* Perform any keepalive function. */
#define CONNRESULT_NONE 0 /* No extra information. */
-#define CONNRESULT_DEAD (1<<0) /* The connection is dead. */
+#define CONNRESULT_DEAD (1 << 0) /* The connection is dead. */
#define TRNSPRT_NONE 0
#define TRNSPRT_TCP 3
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \
* RFC2195 CRAM-MD5 authentication
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifndef CURL_DISABLE_DIGEST_AUTH
* RFC7616 DIGEST-SHA256, DIGEST-SHA512-256 authentication
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifndef CURL_DISABLE_DIGEST_AUTH
else if(curl_strequal(content, "SHA-512-256")) {
#ifdef CURL_HAVE_SHA512_256
digest->algo = ALGO_SHA512_256;
-#else /* ! CURL_HAVE_SHA512_256 */
+#else /* !CURL_HAVE_SHA512_256 */
return CURLE_NOT_BUILT_IN;
-#endif /* ! CURL_HAVE_SHA512_256 */
+#endif /* CURL_HAVE_SHA512_256 */
}
else if(curl_strequal(content, "SHA-512-256-SESS")) {
#ifdef CURL_HAVE_SHA512_256
digest->algo = ALGO_SHA512_256SESS;
-#else /* ! CURL_HAVE_SHA512_256 */
+#else /* !CURL_HAVE_SHA512_256 */
return CURLE_NOT_BUILT_IN;
-#endif /* ! CURL_HAVE_SHA512_256 */
+#endif /* CURL_HAVE_SHA512_256 */
}
else
return CURLE_BAD_CONTENT_ENCODING;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifndef CURL_DISABLE_DIGEST_AUTH
* RFC2831 DIGEST-MD5 authentication
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_DIGEST_AUTH)
* RFC5802 SCRAM-SHA-1 authentication
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_GSASL
* RFC4752 The Kerberos V5 ("GSSAPI") SASL Mechanism
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(HAVE_GSSAPI) && defined(USE_KERBEROS5)
* RFC4752 The Kerberos V5 ("GSSAPI") SASL Mechanism
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_WINDOWS_SSPI) && defined(USE_KERBEROS5)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI)
/* Flag bits definitions based on
https://davenport.sourceforge.net/ntlm.html */
-#define NTLMFLAG_NEGOTIATE_UNICODE (1<<0)
+#define NTLMFLAG_NEGOTIATE_UNICODE (1 << 0)
/* Indicates that Unicode strings are supported for use in security buffer
data. */
-#define NTLMFLAG_NEGOTIATE_OEM (1<<1)
+#define NTLMFLAG_NEGOTIATE_OEM (1 << 1)
/* Indicates that OEM strings are supported for use in security buffer data. */
-#define NTLMFLAG_REQUEST_TARGET (1<<2)
+#define NTLMFLAG_REQUEST_TARGET (1 << 2)
/* Requests that the server's authentication realm be included in the Type 2
message. */
-/* unknown (1<<3) */
-#define NTLMFLAG_NEGOTIATE_SIGN (1<<4)
+/* unknown (1 << 3) */
+#define NTLMFLAG_NEGOTIATE_SIGN (1 << 4)
/* Specifies that authenticated communication between the client and server
should carry a digital signature (message integrity). */
-#define NTLMFLAG_NEGOTIATE_SEAL (1<<5)
+#define NTLMFLAG_NEGOTIATE_SEAL (1 << 5)
/* Specifies that authenticated communication between the client and server
should be encrypted (message confidentiality). */
-#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6)
+#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1 << 6)
/* Indicates that datagram authentication is being used. */
-#define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7)
+#define NTLMFLAG_NEGOTIATE_LM_KEY (1 << 7)
/* Indicates that the LAN Manager session key should be used for signing and
sealing authenticated communications. */
-#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9)
+#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1 << 9)
/* Indicates that NTLM authentication is being used. */
-/* unknown (1<<10) */
+/* unknown (1 << 10) */
-#define NTLMFLAG_NEGOTIATE_ANONYMOUS (1<<11)
+#define NTLMFLAG_NEGOTIATE_ANONYMOUS (1 << 11)
/* Sent by the client in the Type 3 message to indicate that an anonymous
context has been established. This also affects the response fields. */
-#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12)
+#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1 << 12)
/* Sent by the client in the Type 1 message to indicate that a desired
authentication realm is included in the message. */
-#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13)
+#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1 << 13)
/* Sent by the client in the Type 1 message to indicate that the client
workstation's name is included in the message. */
-#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14)
+#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1 << 14)
/* Sent by the server to indicate that the server and client are on the same
machine. Implies that the client may use a pre-established local security
context rather than responding to the challenge. */
-#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15)
+#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1 << 15)
/* Indicates that authenticated communication between the client and server
should be signed with a "dummy" signature. */
-#define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16)
+#define NTLMFLAG_TARGET_TYPE_DOMAIN (1 << 16)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a domain. */
-#define NTLMFLAG_TARGET_TYPE_SERVER (1<<17)
+#define NTLMFLAG_TARGET_TYPE_SERVER (1 << 17)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a server. */
-#define NTLMFLAG_TARGET_TYPE_SHARE (1<<18)
+#define NTLMFLAG_TARGET_TYPE_SHARE (1 << 18)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a share. Presumably, this is for share-level
authentication. Usage is unclear. */
-#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19)
+#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1 << 19)
/* Indicates that the NTLM2 signing and sealing scheme should be used for
protecting authenticated communications. */
-#define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20)
+#define NTLMFLAG_REQUEST_INIT_RESPONSE (1 << 20)
/* unknown purpose */
-#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21)
+#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1 << 21)
/* unknown purpose */
-#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22)
+#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1 << 22)
/* unknown purpose */
-#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23)
+#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1 << 23)
/* Sent by the server in the Type 2 message to indicate that it is including a
Target Information block in the message. */
/* unknown (1<27) */
/* unknown (1<28) */
-#define NTLMFLAG_NEGOTIATE_128 (1<<29)
+#define NTLMFLAG_NEGOTIATE_128 (1 << 29)
/* Indicates that 128-bit encryption is supported. */
-#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30)
+#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1 << 30)
/* Indicates that the client will provide an encrypted master key in
the "Session Key" field of the Type 3 message. */
-#define NTLMFLAG_NEGOTIATE_56 (1<<31)
+#define NTLMFLAG_NEGOTIATE_56 (1 << 31)
/* Indicates that 56-bit encryption is supported. */
/* "NTLMSSP" signature is always in ASCII regardless of the platform */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_WINDOWS_SSPI) && defined(USE_NTLM)
* RFC6749 OAuth 2.0 Authorization Framework
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \
* RFC4178 Simple and Protected GSS-API Negotiation Mechanism
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(HAVE_GSSAPI) && defined(USE_SPNEGO)
* RFC4178 Simple and Protected GSS-API Negotiation Mechanism
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_WINDOWS_SSPI) && defined(USE_SPNEGO)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "vauth.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "../bufref.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "curl_setup.h"
#ifdef USE_NGHTTP2
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGTCP2) && defined(USE_NGHTTP3)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGTCP2) && defined(USE_NGHTTP3)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_QUICHE)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_QUICHE)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_HTTP3) && \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_HTTP3) && \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef HAVE_NETINET_UDP_H
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
+
#include "../bufq.h"
#ifdef USE_HTTP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_LIBSSH
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
-/* #define CURL_LIBSSH2_DEBUG */
-
#include "../curl_setup.h"
#ifdef USE_LIBSSH2
+/* #define CURL_LIBSSH2_DEBUG */
+
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
(void)name_len;
(void)instruction;
(void)instruction_len;
-#endif /* CURL_LIBSSH2_DEBUG */
+#endif /* CURL_LIBSSH2_DEBUG */
if(num_prompts == 1) {
struct connectdata *conn = data->conn;
responses[0].text = curlx_strdup(conn->passwd);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_LIBSSH2
* SPDX-License-Identifier: curl AND ISC
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_SSH
return CURLE_OK;
}
-#endif /* if SSH is used */
+#endif /* USE_SSH */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#include "../urldata.h"
CURLcode Curl_ssh_range(struct Curl_easy *data,
const char *range, curl_off_t filesize,
curl_off_t *startp, curl_off_t *sizep);
+
#endif /* HEADER_CURL_PATH_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_APPLE_SECTRUST
#include "../curl_setup.h"
#if defined(USE_MBEDTLS) || defined(USE_RUSTLS)
+
#include "cipher_suite.h"
/*
CS_TXT_LEN,
};
-#define CS_ZIP_IDX(a, b, c, d, e, f, g, h) \
-{ \
- (uint8_t) ((((a) << 2) & 0xFF) | ((b) & 0x3F) >> 4), \
- (uint8_t) ((((b) << 4) & 0xFF) | ((c) & 0x3F) >> 2), \
- (uint8_t) ((((c) << 6) & 0xFF) | ((d) & 0x3F)), \
- (uint8_t) ((((e) << 2) & 0xFF) | ((f) & 0x3F) >> 4), \
- (uint8_t) ((((f) << 4) & 0xFF) | ((g) & 0x3F) >> 2), \
- (uint8_t) ((((g) << 6) & 0xFF) | ((h) & 0x3F)) \
+#define CS_ZIP_IDX(a, b, c, d, e, f, g, h) \
+{ \
+ (uint8_t)((((a) << 2) & 0xFF) | ((b) & 0x3F) >> 4), \
+ (uint8_t)((((b) << 4) & 0xFF) | ((c) & 0x3F) >> 2), \
+ (uint8_t)((((c) << 6) & 0xFF) | ((d) & 0x3F)), \
+ (uint8_t)((((e) << 2) & 0xFF) | ((f) & 0x3F) >> 4), \
+ (uint8_t)((((f) << 4) & 0xFF) | ((g) & 0x3F) >> 2), \
+ (uint8_t)((((g) << 6) & 0xFF) | ((h) & 0x3F)) \
}
-#define CS_ENTRY(id, a, b, c, d, e, f, g, h) \
-{ \
- id, \
- CS_ZIP_IDX( \
- CS_TXT_IDX_ ## a, CS_TXT_IDX_ ## b, \
- CS_TXT_IDX_ ## c, CS_TXT_IDX_ ## d, \
- CS_TXT_IDX_ ## e, CS_TXT_IDX_ ## f, \
- CS_TXT_IDX_ ## g, CS_TXT_IDX_ ## h \
- ) \
+#define CS_ENTRY(id, a, b, c, d, e, f, g, h) \
+{ \
+ id, \
+ CS_ZIP_IDX( \
+ CS_TXT_IDX_ ## a, CS_TXT_IDX_ ## b, \
+ CS_TXT_IDX_ ## c, CS_TXT_IDX_ ## d, \
+ CS_TXT_IDX_ ## e, CS_TXT_IDX_ ## f, \
+ CS_TXT_IDX_ ## g, CS_TXT_IDX_ ## h \
+ ) \
}
struct cs_entry {
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_MBEDTLS) || defined(USE_RUSTLS)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for all GnuTLS-specific code for the TLS/SSL layer. No code
* but vtls.c should ever call or use these functions.
* Note: do not use the GnuTLS' *_t variable type names in this source code,
* since they were not present in 1.0.X.
*/
-
#include "../curl_setup.h"
#ifdef USE_GNUTLS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_GNUTLS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_OPENSSL) || defined(USE_SCHANNEL)
return FALSE;
}
-#endif /* OPENSSL or SCHANNEL */
+#endif /* USE_OPENSSL || USE_SCHANNEL */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_OPENSSL) || defined(USE_SCHANNEL)
return TRUE;
}
-#endif /* TLS or QUIC backend */
+#endif /* TLS or QUIC backend */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for all mbedTLS-specific code for the TLS/SSL layer. No code
* but vtls.c should ever call or use these functions.
*
*/
-
#include "../curl_setup.h"
#ifdef USE_MBEDTLS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for all OpenSSL-specific code for the TLS/SSL layer. No code
* but vtls.c should ever call or use these functions.
*/
-
#include "../curl_setup.h"
#if defined(USE_QUICHE) || defined(USE_OPENSSL)
return result;
}
-#endif /* quiche or OpenSSL */
+#endif /* USE_QUICHE || USE_OPENSSL */
#ifdef USE_OPENSSL
curlx_dyn_free(&dname);
return result;
}
-#endif /* ! CURL_DISABLE_VERBOSE_STRINGS */
+#endif /* !CURL_DISABLE_VERBOSE_STRINGS */
#ifdef USE_APPLE_SECTRUST
struct ossl_certs_ctx {
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_OPENSSL
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) Jacob Hoffman-Andrews,
- * <github@hoffman-andrews.com>
+ * Copyright (C) Jacob Hoffman-Andrews, <github@hoffman-andrews.com>
* Copyright (C) kpcyrd, <kpcyrd@archlinux.org>
* Copyright (C) Daniel McCarney, <daniel@binaryparadox.net>
*
+#ifndef HEADER_CURL_RUSTLS_H
+#define HEADER_CURL_RUSTLS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) Jacob Hoffman-Andrews,
- * <github@hoffman-andrews.com>
+ * Copyright (C) Jacob Hoffman-Andrews, <github@hoffman-andrews.com>
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#ifndef HEADER_CURL_RUSTLS_H
-#define HEADER_CURL_RUSTLS_H
-
#include "../curl_setup.h"
#ifdef USE_RUSTLS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for all Schannel-specific code for the TLS/SSL layer. No code
* but vtls.c should ever call or use these functions.
*/
-
#include "../curl_setup.h"
#ifdef USE_SCHANNEL
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for Schannel-specific certificate verification. This code should
* only be invoked by code in schannel.c.
*/
-
#include "../curl_setup.h"
#ifdef USE_SCHANNEL
struct Curl_easy;
struct dynbuf;
-#define SSLSUPP_CA_PATH (1<<0) /* supports CAPATH */
-#define SSLSUPP_CERTINFO (1<<1) /* supports CURLOPT_CERTINFO */
-#define SSLSUPP_PINNEDPUBKEY (1<<2) /* supports CURLOPT_PINNEDPUBLICKEY */
-#define SSLSUPP_SSL_CTX (1<<3) /* supports CURLOPT_SSL_CTX */
-#define SSLSUPP_HTTPS_PROXY (1<<4) /* supports access via HTTPS proxies */
-#define SSLSUPP_TLS13_CIPHERSUITES (1<<5) /* supports TLS 1.3 ciphersuites */
-#define SSLSUPP_CAINFO_BLOB (1<<6)
-#define SSLSUPP_ECH (1<<7)
-#define SSLSUPP_CA_CACHE (1<<8)
-#define SSLSUPP_CIPHER_LIST (1<<9) /* supports TLS 1.0-1.2 ciphersuites */
-#define SSLSUPP_SIGNATURE_ALGORITHMS (1<<10) /* supports TLS sigalgs */
+#define SSLSUPP_CA_PATH (1 << 0) /* supports CAPATH */
+#define SSLSUPP_CERTINFO (1 << 1) /* supports CURLOPT_CERTINFO */
+#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
+#define SSLSUPP_SSL_CTX (1 << 3) /* supports CURLOPT_SSL_CTX */
+#define SSLSUPP_HTTPS_PROXY (1 << 4) /* supports access via HTTPS proxies */
+#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
+#define SSLSUPP_CAINFO_BLOB (1 << 6)
+#define SSLSUPP_ECH (1 << 7)
+#define SSLSUPP_CA_CACHE (1 << 8)
+#define SSLSUPP_CIPHER_LIST (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
+#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */
#ifdef USE_ECH
# include "../curlx/base64.h"
# define ECH_ENABLED(__data__) \
- (__data__->set.tls_ech && \
- !(__data__->set.tls_ech & CURLECH_DISABLE)\
- )
+ (__data__->set.tls_ech && !(__data__->set.tls_ech & CURLECH_DISABLE))
#endif /* USE_ECH */
#define ALPN_ACCEPTED "ALPN: server accepted "
const curl_ssl_backend ***avail);
#ifndef MAX_PINNED_PUBKEY_SIZE
-#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1MB */
+#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1 MiB */
#endif
curl_sslbackend Curl_ssl_backend(void);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#ifdef USE_SSL
*
***************************************************************************/
#include "../curl_setup.h"
+
#include "../cfilters.h"
#include "../urldata.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_SSL) && defined(USE_SSLS_EXPORT)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* Source file for all wolfSSL specific code for the TLS/SSL layer. No code
* but vtls.c should ever call or use these functions.
*
*/
-
#include "../curl_setup.h"
#ifdef USE_WOLFSSL
wolfSSL_FreeArrays(wssl->ssl);
}
}
-#endif /* OPENSSL_EXTRA */
+#endif /* OPENSSL_EXTRA */
detail = wolfSSL_get_error(wssl->ssl, ret);
CURL_TRC_CF(data, cf, "wolfSSL_connect() -> %d, detail=%d", ret, detail);
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
#endif /* WANT_EXTRACT_CERTINFO */
-#endif /* USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL or USE_MBEDTLS or
+#endif /* USE_GNUTLS || USE_WOLFSSL || USE_SCHANNEL || USE_MBEDTLS ||
USE_RUSTLS */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "../curl_setup.h"
#if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
/* used by unit1657.c */
CURLcode Curl_x509_getASN1Element(struct Curl_asn1Element *elem,
const char *beg, const char *end);
-#endif
-#endif
+#endif /* USE_GNUTLS || USE_SCHANNEL || USE_MBEDTLS || RUSTLS */
+#endif /* UNITTESTS */
-#endif /* USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL or USE_MBEDTLS or
+#endif /* USE_GNUTLS || USE_WOLFSSL || USE_SCHANNEL || USE_MBEDTLS ||
USE_RUSTLS */
#endif /* HEADER_CURL_X509ASN1_H */
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_help.h"
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/*
* The purpose of this tool is to figure out which, if any, features that are
* disabled which should otherwise exist and work. These are not visible in
* Disabled protocols are visible in curl_version_info() and are not included
* in this table.
*/
-
#include "curl_setup.h"
+
#include "multihandle.h" /* for ENABLE_WAKEUP */
#include "tool_xattr.h" /* for USE_XATTR */
#include "curl_sha512_256.h" /* for CURL_HAVE_SHA512_256 */
#include "asyn.h" /* for CURLRES_ARES */
#include "fake_addrinfo.h" /* for USE_FAKE_GETADDRINFO */
+
#include <stdio.h>
static const char *disabled[] = {
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "tool_setup.h"
#ifndef CURL_DISABLE_LIBCURL_OPTION
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "tool_setup.h"
+
#ifndef CURL_DISABLE_LIBCURL_OPTION
/* linked-list structure with last node cache for easysrc */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "tool_setup.h"
+
#include "tool_sdecls.h"
#include "tool_urlglob.h"
#include "var.h"
*
***************************************************************************/
#include "tool_setup.h"
+
#ifndef CURL_DISABLE_LIBCURL_OPTION
/* global variable declarations, for easy-interface source code generation */
#ifndef CURL_DISABLE_IPFS
#define MAX_GATEWAY_URL_LEN 10000
-
CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
struct OperationConfig *config);
+#endif
#endif /* HEADER_CURL_TOOL_IPFS_H */
-#endif /* !CURL_DISABLE_IPFS */
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_help.h"
/*
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_cfgable.h"
void warnf(const char *fmt, ...) CURL_PRINTF(1, 2);
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_cb_hdr.h"
#include "tool_cb_prg.h"
#include "tool_sdecls.h"
*
***************************************************************************/
#include "tool_setup.h"
-#include "tool_operate.h"
+#include "tool_operate.h"
#include "tool_cfgable.h"
#include "tool_doswin.h"
#include "tool_operhlp.h"
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_operate.h"
#include "tool_progress.h"
#define HAVE_FTRUNCATE 1
#define USE_TOOL_FTRUNCATE 1
-#endif /* ! HAVE_FTRUNCATE */
+#endif /* !HAVE_FTRUNCATE */
#endif /* _WIN32 */
#endif /* HEADER_CURL_TOOL_SETUP_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "tool_setup.h"
+
#include "tool_stderr.h"
#include "tool_msgs.h"
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_cfgable.h"
void tool_init_stderr(void);
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_operate.h"
typedef enum {
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_writeout.h"
int jsonquoted(const char *in, size_t len, struct dynbuf *out, bool lowercase);
*
***************************************************************************/
#include "tool_setup.h"
+
#include "tool_xattr.h"
#ifdef USE_XATTR
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "tool_getparam.h"
struct tool_var {
sendcontrol "500 silly you, go away\r\n";
return;
}
- $port = ($5<<8)+$6;
+ $port = ($5 << 8) + $6;
$addr = "$1.$2.$3.$4";
}
# EPRT |2|::1|49706|
static 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;
}
NULL
};
static int ix = 0;
- (void)nmemb;
(void)stream;
if(chunks[ix]) {
size_t len = strlen(chunks[ix]);
void tutil_rlim2str(char *buf, size_t len, rlim_t val);
#endif
-#endif /* HEADER_CURL_LIBTEST_TESTUTIL_H */
+#endif /* HEADER_CURL_LIBTEST_TESTUTIL_H */
UNITTEST_END(curl_global_cleanup())
}
-#else /* CURL_DISABLE_DOH or not HTTPSRR enabled */
+#else /* CURL_DISABLE_DOH || !USE_HTTPSRR */
static CURLcode test_unit1658(const char *arg)
{