- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.
Closes #21000
Checks:
- clang-analyzer-*
- -clang-analyzer-optin.performance.Padding
- - -clang-analyzer-security.ArrayBound # due to false positives with clang-tidy v21.1.0
+ - -clang-analyzer-security.ArrayBound # due to false positives with clang-tidy v21.1.0+
- -clang-analyzer-security.insecureAPI.bzero # for FD_ZERO() (seen on macOS)
- -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
- -clang-diagnostic-nullability-extension
- name: 'openssl4'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/openssl4/build/lib
- PKG_CONFIG_PATH: "/home/runner/openssl4/build/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/nghttp2-openssl4/build/lib/pkgconfig"
configure: >-
- name: 'openssl4'
tflags: '--min=1640'
- PKG_CONFIG_PATH: "/home/runner/openssl4/build/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-openssl4/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
- name: 'boringssl'
tflags: '--min=1790'
- PKG_CONFIG_PATH: "/home/runner/boringssl/build/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/runner/boringssl/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
install_packages: libp11-kit-dev libssh-dev
tflags: '--min=1840'
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib
- PKG_CONFIG_PATH: "/home/runner/nettle/build/lib64/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/runner/nettle/build/lib64/pkgconfig:\
/home/runner/gnutls/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2/build/lib/pkgconfig:\
-Wl,-rpath,/home/runner/rustls/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/gsasl/lib
- PKG_CONFIG_PATH: "/home/runner/wolfssl-opensslextra/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/runner/wolfssl-opensslextra/lib/pkgconfig:\
/home/runner/mbedtls/lib/pkgconfig:\
/home/runner/rustls/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/gsasl/lib/pkgconfig"
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
- PKG_CONFIG_PATH: "/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
generate: >-
CC: clang-20
CFLAGS: -fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g
LDFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=undefined,integer -ldl -lubsan -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
- PKG_CONFIG_PATH: "/home/linuxbrew/.linuxbrew/opt/libssh2/lib/pkgconfig:\
+ PKG_CONFIG_PATH: "\
+ /home/linuxbrew/.linuxbrew/opt/libssh2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
endif()
endif()
- #
+ # Assemble list of flags
set(_picky_skipped "")
foreach(_ccopt IN LISTS _picky_enable)
- `SHARE_LIB_OBJECT`: Build shared and static libcurl in a single pass (requires CMake 3.12 or newer). Default: `ON` for Windows
- `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty)
-## CA bundle options
+## Root CA options
- `CURL_CA_BUNDLE`: Absolute path to the CA bundle. Set `none` to disable or `auto` for auto-detection. Default: `auto`
- `CURL_CA_EMBED`: Absolute path to the CA bundle to embed in the curl tool. Default: (disabled)
- `CURL_CA_PATH`: Absolute path to a directory containing CA certificates stored individually.
Set `none` to disable or `auto` for auto-detection. Default: `auto`
- `CURL_CA_SEARCH_SAFE`: Enable safe CA bundle search (within the curl tool directory) on Windows. Default: `OFF`
+- `USE_APPLE_SECTRUST`: Use Apple OS-native certificate verification. Default: `OFF`
## Enabling features
- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled and target supports threading.
- `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. Default: `OFF`
- `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON`
+- `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF`
- `USE_ECH`: Enable ECH support. Default: `OFF`
- `USE_HTTPSRR`: Enable HTTPS RR support. Default: `OFF`
- `USE_SSLS_EXPORT`: Enable experimental SSL session import/export. Default: `OFF`
+- `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF`
+- `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON`
## Disabling features
- `CURL_ZLIB`: Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO`
- `CURL_ZSTD`: Use zstd (`ON`, `OFF` or `AUTO`). Default: `AUTO`
- `ENABLE_ARES`: Enable c-ares support. Default: `OFF`
-- `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF`
-- `USE_APPLE_SECTRUST`: Use Apple OS-native certificate verification. Default: `OFF`
- `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON`
- `USE_NGHTTP2`: Use nghttp2 library. Default: `ON`
- `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF`
- `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF`
-- `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF`
-- `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON`
## Dependency options (via CMake)
/* without the hex output, we can fit more on screen */
width = 0x40;
- fprintf(stderr, "%s, %10.10lu bytes (0x%8.8lx)\n",
+ fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
for(i = 0; i < size; i += width) {
/* without the hex output, we can fit more on screen */
width = 0x40;
- fprintf(stderr, "%s, %10.10lu bytes (0x%8.8lx)\n",
+ fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
for(i = 0; i < size; i += width) {
size_t c;
unsigned int width = 0x10;
- fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
+ fprintf(stream, "%s, %lu bytes (0x%lx)\n",
text, (long)size, (long)size);
for(i = 0; i < size; i += width) {
}
void Curl_async_ares_shutdown(struct Curl_easy *data,
- struct Curl_resolv_async *async)
+ struct Curl_resolv_async *async)
{
/* c-ares has a method to "cancel" operations on a channel, but
* as reported in #18216, this does not totally reset the channel
int itimeout_ms;
#if TIMEDIFF_T_MAX > INT_MAX
- itimeout_ms = (timeout_ms > INT_MAX) ? INT_MAX :
- ((timeout_ms < 0) ? -1 : (int)timeout_ms);
+ itimeout_ms = (timeout_ms > INT_MAX) ? INT_MAX :
+ ((timeout_ms < 0) ? -1 : (int)timeout_ms);
#else
- itimeout_ms = (int)timeout_ms;
+ itimeout_ms = (int)timeout_ms;
#endif
max_timeout.tv_sec = itimeout_ms / 1000;
max_timeout.tv_usec = (itimeout_ms % 1000) * 1000;
return 1000;
}
-static const struct Curl_addrinfo *
-async_ares_get_ai(const struct Curl_addrinfo *ai,
- int ai_family, unsigned int index)
+static const struct Curl_addrinfo *async_ares_get_ai(
+ const struct Curl_addrinfo *ai,
+ int ai_family,
+ unsigned int index)
{
unsigned int i = 0;
for(i = 0; ai; ai = ai->ai_next) {
return NULL;
}
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
- struct Curl_resolv_async *async,
- int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+ struct Curl_resolv_async *async,
+ int ai_family,
+ unsigned int index)
{
struct async_ares_ctx *ares = &async->ares;
}
#ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
- struct Curl_resolv_async *async)
+const struct Curl_https_rrinfo *Curl_async_get_https(
+ struct Curl_easy *data,
+ struct Curl_resolv_async *async)
{
if(Curl_async_knows_https(data, async))
return &async->ares.hinfo;
* Waits for a resolve to finish. This function should be avoided since using
* this risk getting the multi interface to "hang".
*
- * 'entry' MUST be non-NULL.
+ * 'pdns' MUST be non-NULL.
*
* Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved,
* CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors.
* async_ares_node2addr() converts an address list provided by c-ares
* to an internal libcurl compatible list.
*/
-static struct Curl_addrinfo *
-async_ares_node2addr(struct ares_addrinfo_node *node)
+static struct Curl_addrinfo *async_ares_node2addr(
+ struct ares_addrinfo_node *node)
{
/* traverse the ares_addrinfo_node list */
struct ares_addrinfo_node *ai;
}
/* Initialize context for threaded resolver */
-static struct async_thrdd_item *
-async_thrdd_item_create(struct Curl_easy *data,
- uint32_t resolv_id, uint8_t dns_queries,
- const char *hostname, uint16_t port,
- uint8_t transport)
+static struct async_thrdd_item *async_thrdd_item_create(
+ struct Curl_easy *data,
+ uint32_t resolv_id, uint8_t dns_queries,
+ const char *hostname, uint16_t port,
+ uint8_t transport)
{
size_t hostlen = strlen(hostname);
struct async_thrdd_item *item;
#endif
void Curl_async_thrdd_shutdown(struct Curl_easy *data,
- struct Curl_resolv_async *async)
+ struct Curl_resolv_async *async)
{
Curl_async_thrdd_destroy(data, async);
}
struct async_thrdd_item *item = arg;
#ifdef DEBUGBUILD
- if(item->delay_ms) {
- curlx_wait_ms(item->delay_ms);
- }
- if(item->delay_fail_ms) {
- curlx_wait_ms(item->delay_fail_ms);
- return;
- }
+ if(item->delay_ms) {
+ curlx_wait_ms(item->delay_ms);
+ }
+ if(item->delay_fail_ms) {
+ curlx_wait_ms(item->delay_fail_ms);
+ return;
+ }
#endif
item->res = Curl_ipv4_resolve_r(item->hostname, item->port);
if(!item->res) {
}
}
- infof(data, "Host %s:%u resolved IPv%c: %s",
- item->hostname, item->port,
- (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
- (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
+ infof(data, "Host %s:%u resolved IPv%c: %s", item->hostname, item->port,
+ (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
+ (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
out:
curlx_dyn_free(&tmp);
}
return result;
}
-static const struct Curl_addrinfo *
-async_thrdd_get_ai(const struct Curl_addrinfo *ai,
- int ai_family, unsigned int index)
+static const struct Curl_addrinfo *async_thrdd_get_ai(
+ const struct Curl_addrinfo *ai,
+ int ai_family, unsigned int index)
{
unsigned int i = 0;
for(i = 0; ai; ai = ai->ai_next) {
return NULL;
}
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
- struct Curl_resolv_async *async,
- int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+ struct Curl_resolv_async *async,
+ int ai_family,
+ unsigned int index)
{
struct async_thrdd_ctx *thrdd = &async->thrdd;
}
#ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
- struct Curl_resolv_async *async)
+const struct Curl_https_rrinfo *Curl_async_get_https(
+ struct Curl_easy *data,
+ struct Curl_resolv_async *async)
{
#ifdef USE_HTTPSRR_ARES
if(Curl_async_knows_https(data, async))
CURLcode Curl_async_getaddrinfo(struct Curl_easy *data,
struct Curl_resolv_async *async);
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
- struct Curl_resolv_async *async,
- int ai_family, unsigned int index);
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+ struct Curl_resolv_async *async,
+ int ai_family,
+ unsigned int index);
#ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
- struct Curl_resolv_async *async);
+const struct Curl_https_rrinfo *Curl_async_get_https(
+ struct Curl_easy *data,
+ struct Curl_resolv_async *async);
bool Curl_async_knows_https(struct Curl_easy *data,
struct Curl_resolv_async *async);
#endif /* USE_HTTPSRR */
};
void Curl_async_ares_shutdown(struct Curl_easy *data,
- struct Curl_resolv_async *async);
+ struct Curl_resolv_async *async);
void Curl_async_ares_destroy(struct Curl_easy *data,
struct Curl_resolv_async *async);
* Waits for a resolve to finish. This function should be avoided since using
* this risk getting the multi interface to "hang".
*
- * On return 'entry' is assigned the resolved dns (CURLE_OK or NULL otherwise.
+ * On return 'dns' is assigned the resolved dns (CURLE_OK or NULL otherwise.
*
* Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved,
* CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors.
/* convert these functions if an asynch resolver is not used */
#define Curl_async_global_init() CURLE_OK
#define Curl_async_global_cleanup() Curl_nop_stmt
-#define Curl_async_get_ai(a,b,c,d) NULL
-#define Curl_async_await(a,b,c) CURLE_COULDNT_RESOLVE_HOST
+#define Curl_async_get_ai(a, b, c, d) NULL
+#define Curl_async_await(a, b, c) CURLE_COULDNT_RESOLVE_HOST
#define Curl_async_take_result(x, y, z) CURLE_COULDNT_RESOLVE_HOST
#define Curl_async_pollset(x, y, z) CURLE_OK
#endif /* !CURLRES_ASYNCH */
struct Curl_resolv_async *async);
#else /* !USE_CURL_ASYNC */
-#define Curl_async_shutdown(x,y) Curl_nop_stmt
+#define Curl_async_shutdown(x, y) Curl_nop_stmt
#endif /* USE_CURL_ASYNC */
/********** end of generic resolver interface functions *****************/
char hostname[1];
};
-static struct cf_dns_ctx *
-cf_dns_ctx_create(struct Curl_easy *data, uint8_t dns_queries,
- const char *hostname, uint16_t port, uint8_t transport,
- bool abstract_unix_socket,
- struct Curl_dns_entry *dns)
+static struct cf_dns_ctx *cf_dns_ctx_create(struct Curl_easy *data,
+ uint8_t dns_queries,
+ const char *hostname,
+ uint16_t port, uint8_t transport,
+ bool abstract_unix_socket,
+ struct Curl_dns_entry *dns)
{
struct cf_dns_ctx *ctx;
size_t hlen = strlen(hostname);
* there, thus overriding any defaults that might have been set above. */
hostname = ehost->name;
port = conn->bits.conn_to_port ?
- conn->conn_to_port : (uint16_t)conn->remote_port;
+ conn->conn_to_port : (uint16_t)conn->remote_port;
}
if(!hostname) {
return Curl_cf_dns_result(conn->cfilter[sockindex]);
}
-static const struct Curl_addrinfo *
-cf_dns_get_nth_ai(struct Curl_cfilter *cf, const struct Curl_addrinfo *ai,
- int ai_family, unsigned int index)
+static const struct Curl_addrinfo *cf_dns_get_nth_ai(
+ struct Curl_cfilter *cf,
+ const struct Curl_addrinfo *ai,
+ int ai_family, unsigned int index)
{
struct cf_dns_ctx *ctx = cf->ctx;
unsigned int i = 0;
* first "resolve" filter underneath `cf`. If the DNS resolving is
* not done yet or if no address for the family exists, returns NULL.
*/
-const struct Curl_addrinfo *
-Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- int ai_family,
- unsigned int index)
+const struct Curl_addrinfo *Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
+ struct Curl_easy *data,
+ int ai_family,
+ unsigned int index)
{
(void)data;
for(; cf; cf = cf->next) {
* first "resolve" filter at the connection. If the DNS resolving is
* not done yet or if no address for the family exists, returns NULL.
*/
-const struct Curl_addrinfo *
-Curl_conn_dns_get_ai(struct Curl_easy *data,
- int sockindex,
- int ai_family,
- unsigned int index)
+const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
+ int sockindex, int ai_family,
+ unsigned int index)
{
struct connectdata *conn = data->conn;
- return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data,
- ai_family, index);
+ return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data, ai_family, index);
}
#ifdef USE_HTTPSRR
* connection. If the DNS resolving is not done yet or if there
* is no HTTPS-RR info, returns NULL.
*/
-const struct Curl_https_rrinfo *
-Curl_conn_dns_get_https(struct Curl_easy *data, int sockindex)
+const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
+ int sockindex)
{
struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
for(; cf; cf = cf->next) {
* `Curl_conn_dns_get_ai()`. */
bool Curl_conn_dns_has_any_ai(struct Curl_easy *data, int sockindex);
-const struct Curl_addrinfo *
-Curl_conn_dns_get_ai(struct Curl_easy *data,
- int sockindex,
- int ai_family,
- unsigned int index);
+const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
+ int sockindex,
+ int ai_family,
+ unsigned int index);
-const struct Curl_addrinfo *
-Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- int ai_family,
- unsigned int index);
+const struct Curl_addrinfo *Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
+ struct Curl_easy *data,
+ int ai_family,
+ unsigned int index);
#ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_conn_dns_get_https(struct Curl_easy *data, int sockindex);
+const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
+ int sockindex);
bool Curl_conn_dns_resolved_https(struct Curl_easy *data, int sockindex);
#else
-#define Curl_conn_dns_get_https(a,b) NULL
-#define Curl_conn_dns_resolved_https(a,b) TRUE
+#define Curl_conn_dns_get_https(a, b) NULL
+#define Curl_conn_dns_resolved_https(a, b) TRUE
#endif
-
extern struct Curl_cftype Curl_cft_dns;
#endif /* HEADER_CURL_CF_DNS_H */
return 0;
}
-static CURLcode proxy_h2_submit(int32_t *pstream_id,
- struct Curl_cfilter *cf,
- struct Curl_easy *data,
- nghttp2_session *h2,
- struct httpreq *req,
- const nghttp2_priority_spec *pri_spec,
- void *stream_user_data,
- nghttp2_data_source_read_callback read_callback,
- void *read_ctx)
+static CURLcode proxy_h2_submit(
+ int32_t *pstream_id,
+ struct Curl_cfilter *cf,
+ struct Curl_easy *data,
+ nghttp2_session *h2,
+ struct httpreq *req,
+ const nghttp2_priority_spec *pri_spec,
+ void *stream_user_data,
+ nghttp2_data_source_read_callback read_callback,
+ void *read_ctx)
{
struct dynhds h2_headers;
nghttp2_nv *nva = NULL;
iter->n = 0;
}
-static const struct Curl_addrinfo *
-cf_ai_iter_next(struct cf_ai_iter *iter,
- struct Curl_easy *data)
+static const struct Curl_addrinfo *cf_ai_iter_next(struct cf_ai_iter *iter,
+ struct Curl_easy *data)
{
const struct Curl_addrinfo *addr;
defined(TCP_KEEPALIVE) || defined(TCP_KEEPALIVE_THRESHOLD) || \
defined(TCP_KEEPINTVL) || defined(TCP_KEEPALIVE_ABORT_THRESHOLD)
#if defined(USE_WINSOCK) || \
- (defined(__sun) && !defined(TCP_KEEPIDLE)) || \
- (defined(__DragonFly__) && __DragonFly_version < 500702) || \
- (defined(_WIN32) && !defined(TCP_KEEPIDLE))
+ (defined(__sun) && !defined(TCP_KEEPIDLE)) || \
+ (defined(__DragonFly__) && __DragonFly_version < 500702) || \
+ (defined(_WIN32) && !defined(TCP_KEEPIDLE))
/* Solaris < 11.4, DragonFlyBSD < 500702 and Windows < 10.0.16299
* use millisecond units. */
#define KEEPALIVE_FACTOR(x) ((x) *= 1000)
* to take a type parameter instead.
*/
uint8_t dns_queries = (af == AF_INET) ?
- CURL_DNSQ_A : (CURL_DNSQ_A|CURL_DNSQ_AAAA);
+ CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
#ifdef USE_IPV6
if(af == AF_INET6)
dns_queries = CURL_DNSQ_AAAA;
#pragma enum(int)
-
/* ---------------------------------------------------------------- */
/* Global configuration parameters: normally generated by autoconf. */
/* ---------------------------------------------------------------- */
/* Default define to enable threaded asynchronous DNS lookups. */
#if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
- !defined(USE_RESOLV_THREADED)
+ !defined(USE_RESOLV_THREADED)
# define USE_RESOLV_THREADED 1
#endif
/* ---------------------------------------------------------------- */
#ifndef CURL_WINDOWS_UWP
-#define HAVE_LDAP_SSL 1
+#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
/* Define to use the Windows crypto library. */
/* this function return errors on OOM etc, not on plain cookie format
problems */
-static CURLcode
-parse_cookie_header(struct Curl_easy *data,
- struct Cookie *co,
- struct CookieInfo *ci,
- bool *okay, /* if the cookie was fine */
- const char *ptr,
- const char *domain, /* default domain */
- const char *path, /* full path used when this cookie is
- set, used to get default path for
- the cookie unless set */
- bool secure) /* TRUE if connection is over secure
- origin */
+static CURLcode parse_cookie_header(
+ struct Curl_easy *data,
+ struct Cookie *co,
+ struct CookieInfo *ci,
+ bool *okay, /* if the cookie was fine */
+ const char *ptr,
+ const char *domain, /* default domain */
+ const char *path, /* full path used when this cookie is
+ set, used to get default path for
+ the cookie unless set */
+ bool secure) /* TRUE if connection is over secure origin */
{
/* This line was read off an HTTP-header */
time_t now = 0;
* IPv6 address.
*
*/
-CURLcode
-Curl_cookie_add(struct Curl_easy *data,
- struct CookieInfo *ci,
- bool httpheader, /* TRUE if HTTP header-style line */
- bool noexpire, /* if TRUE, skip remove_expired() */
- const char *lineptr, /* first character of the line */
- const char *domain, /* default domain */
- const char *path, /* full path used when this cookie is set,
- used to get default path for the cookie
- unless set */
- bool secure) /* TRUE if connection is over secure origin */
+CURLcode Curl_cookie_add(
+ struct Curl_easy *data,
+ struct CookieInfo *ci,
+ bool httpheader, /* TRUE if HTTP header-style line */
+ bool noexpire, /* if TRUE, skip remove_expired() */
+ const char *lineptr, /* first character of the line */
+ const char *domain, /* default domain */
+ const char *path, /* full path used when this cookie is set, used
+ to get default path for the cookie unless set */
+ bool secure) /* TRUE if connection is over secure origin */
{
struct Cookie comem;
struct Cookie *co;
void Curl_cookie_clearsess(struct CookieInfo *ci);
#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
-#define Curl_cookie_list(x) NULL
+#define Curl_cookie_list(x) NULL
#define Curl_cookie_loadfiles(x) CURLE_OK
-#define Curl_cookie_init() NULL
-#define Curl_cookie_run(x) Curl_nop_stmt
-#define Curl_cookie_cleanup(x) Curl_nop_stmt
+#define Curl_cookie_init() NULL
+#define Curl_cookie_run(x) Curl_nop_stmt
+#define Curl_cookie_cleanup(x) Curl_nop_stmt
#define Curl_flush_cookies(x, y) Curl_nop_stmt
#else
void Curl_flush_cookies(struct Curl_easy *data, bool cleanup);
#define ISDIGIT(x) (((x) >= '0') && ((x) <= '9'))
#define ISBLANK(x) (((x) == ' ') || ((x) == '\t'))
#define ISSPACE(x) (ISBLANK(x) || (((x) >= 0xa) && ((x) <= 0x0d)))
-#define ISURLPUNTCS(x) (((x) == '-') || ((x) == '.') || ((x) == '_') || \
- ((x) == '~'))
+#define ISURLPUNTCS(x) \
+ (((x) == '-') || ((x) == '.') || ((x) == '_') || ((x) == '~'))
#define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
-#define ISNEWLINE(x) (((x) == '\n') || (x) == '\r')
+#define ISNEWLINE(x) (((x) == '\n') || (x) == '\r')
#endif /* HEADER_CURL_CTYPE_H */
char creds[250];
};
-static OM_uint32
-stub_gss_init_sec_context(OM_uint32 *min,
- gss_cred_id_t initiator_cred_handle,
- struct stub_gss_ctx_id_t_desc **context,
- gss_name_t target_name,
- const gss_OID mech_type,
- OM_uint32 req_flags,
- OM_uint32 time_req,
- const gss_channel_bindings_t input_chan_bindings,
- gss_buffer_desc *input_token,
- gss_OID *actual_mech_type,
- gss_buffer_desc *output_token,
- OM_uint32 *ret_flags,
- OM_uint32 *time_rec)
+static OM_uint32 stub_gss_init_sec_context(
+ OM_uint32 *min,
+ gss_cred_id_t initiator_cred_handle,
+ struct stub_gss_ctx_id_t_desc **context,
+ gss_name_t target_name,
+ const gss_OID mech_type,
+ OM_uint32 req_flags,
+ OM_uint32 time_req,
+ const gss_channel_bindings_t input_chan_bindings,
+ gss_buffer_desc *input_token,
+ gss_OID *actual_mech_type,
+ gss_buffer_desc *output_token,
+ OM_uint32 *ret_flags,
+ OM_uint32 *time_rec)
{
struct stub_gss_ctx_id_t_desc *ctx = NULL;
return GSS_S_CONTINUE_NEEDED;
}
-static OM_uint32
-stub_gss_delete_sec_context(OM_uint32 *min,
- struct stub_gss_ctx_id_t_desc **context,
- gss_buffer_t output_token)
+static OM_uint32 stub_gss_delete_sec_context(
+ OM_uint32 *min,
+ struct stub_gss_ctx_id_t_desc **context,
+ gss_buffer_t output_token)
{
(void)output_token;
key[4] = (char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4));
key[5] = (char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
key[6] = (char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
- key[7] = (char) ((key_56[6] << 1) & 0xFF);
+ key[7] = (char)((key_56[6] << 1) & 0xFF);
}
#ifdef USE_OPENSSL_DES
#endif
/* based on logic in "curl/mprintf.h" */
-#if (defined(__GNUC__) || defined(__clang__) || \
- defined(__IAR_SYSTEMS_ICC__)) && \
- defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+#if (defined(__GNUC__) || defined(__clang__) || \
+ defined(__IAR_SYSTEMS_ICC__)) && \
+ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#if defined(__MINGW32__) && !defined(__clang__)
-#define CURL_PRINTF(fmt, arg) \
- __attribute__((format(gnu_printf, fmt, arg)))
+#define CURL_PRINTF(fmt, arg) __attribute__((format(gnu_printf, fmt, arg)))
#else
-#define CURL_PRINTF(fmt, arg) \
- __attribute__((format(__printf__, fmt, arg)))
+#define CURL_PRINTF(fmt, arg) __attribute__((format(__printf__, fmt, arg)))
#endif
#else
#define CURL_PRINTF(fmt, arg)
(defined(__GNUC__) && __GNUC__ <= 14)) && \
defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
!defined(__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__)
-#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ \
+#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#endif
#endif
#if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_MBEDTLS) || \
- defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
- defined(USE_RUSTLS)
+ defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || defined(USE_RUSTLS)
#define USE_SSL /* SSL support has been enabled */
#endif
#endif
/* Single point where USE_SPNEGO definition might be defined */
-#if !defined(CURL_DISABLE_NEGOTIATE_AUTH) && \
- (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
+#if !defined(CURL_DISABLE_NEGOTIATE_AUTH) && \
+ (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
#define USE_SPNEGO
#endif
/* Single point where USE_KERBEROS5 definition might be defined */
-#if !defined(CURL_DISABLE_KERBEROS_AUTH) && \
- (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
+#if !defined(CURL_DISABLE_KERBEROS_AUTH) && \
+ (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
#define USE_KERBEROS5
#endif
/* Single point where USE_NTLM definition might be defined */
#ifdef CURL_ENABLE_NTLM
-# if (defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT)) || \
- defined(USE_GNUTLS) || \
- (defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB)) || \
- defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \
+# if (defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT)) || \
+ defined(USE_GNUTLS) || \
+ (defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB)) || \
+ defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \
(defined(USE_WOLFSSL) && defined(HAVE_WC_DES_ECBENCRYPT))
# define USE_CURL_NTLM_CORE
# endif
/* fallthrough attribute */
#ifndef FALLTHROUGH
-#if (defined(__GNUC__) && __GNUC__ >= 7) || \
- (defined(__clang__) && __clang_major__ >= 10)
+#if (defined(__GNUC__) && __GNUC__ >= 7) || \
+ (defined(__clang__) && __clang_major__ >= 10)
# define FALLTHROUGH() __attribute__((fallthrough))
#else
# define FALLTHROUGH() do {} while(0)
* 'bool' stuff compatible with HP-UX headers.
*/
#if defined(__hpux) && !defined(HAVE_BOOL_T)
- typedef int bool;
+typedef int bool;
# define false 0
# define true 1
# define HAVE_BOOL_T
* global namespace though, so use bool_false and bool_true.
*/
#ifndef HAVE_BOOL_T
- typedef enum {
- bool_false = 0,
- bool_true = 1
- } bool;
+typedef enum {
+ bool_false = 0,
+ bool_true = 1
+} bool;
/*
* Use a define to let 'true' and 'false' use those enums. There
size_t length)
{
do {
- word32 ilen = (word32) CURLMIN(length, UINT_MAX);
+ word32 ilen = (word32)CURLMIN(length, UINT_MAX);
if(wc_Sha512_256Update(ctx, data, ilen))
return CURLE_SSL_CIPHER;
length -= ilen;
/* ** This implementation of SHA-512/256 hash calculation was originally ** *
* ** written by Evgeny Grin (Karlson2k) for GNU libmicrohttpd. ** *
* ** The author ported the code to libcurl. The ported code is provided ** *
- * ** under curl license. ** *
- * ** This is a minimal version with minimal optimizations. Performance ** *
- * ** can be significantly improved. Big-endian store and load macros ** *
- * ** are obvious targets for optimization. ** */
+ * ** under curl license. ** */
#ifdef __GNUC__
# if defined(__has_attribute) && defined(__STDC_VERSION__)
return 0;
}
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
- (CURL_STDCALL *func) (void *), void *arg)
+curl_thread_t Curl_thread_create(
+ CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg)
{
curl_thread_t t = curlx_malloc(sizeof(pthread_t));
struct Curl_actual_call *ac = NULL;
#elif defined(_WIN32)
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
- (CURL_STDCALL *func) (void *), void *arg)
+curl_thread_t Curl_thread_create(
+ CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg)
{
curl_thread_t t = CreateThread(NULL, 0, func, arg, 0, NULL);
if(!t) {
* that will be most likely in the past, as far as POSIX abstime is
* concerned. */
#ifdef HAVE_GETTIMEOFDAY
- struct timeval tv;
- (void)gettimeofday(&tv, NULL);
- now.tv_sec = tv.tv_sec;
- now.tv_usec = (int)tv.tv_usec;
+ struct timeval tv;
+ (void)gettimeofday(&tv, NULL);
+ now.tv_sec = tv.tv_sec;
+ now.tv_usec = (int)tv.tv_usec;
#else
- now.tv_sec = time(NULL);
- now.tv_usec = 0;
+ now.tv_sec = time(NULL);
+ now.tv_usec = 0;
#endif
ts.tv_sec = now.tv_sec + (timeout_ms / 1000);
#ifdef USE_THREADS
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
- (CURL_STDCALL *func) (void *), void *arg);
+curl_thread_t Curl_thread_create(
+ CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg);
void Curl_thread_destroy(curl_thread_t *hnd);
#define DICT_DEFINE2 "/D:"
#define DICT_DEFINE3 "/LOOKUP:"
-
#define DYN_DICT_WORD 10000
static char *unescape_word(const char *input)
{
return i;
}
-UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
- struct Curl_addrinfo **addr);
/*
* Curl_shuffle_addr() shuffles the order of addresses in a 'Curl_addrinfo'
* struct by re-linking its linked list.
*
* @unittest: 1608
*/
+UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
+ struct Curl_addrinfo **addr);
UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
struct Curl_addrinfo **addr)
{
return FALSE;
}
-static struct Curl_dns_entry *
-dnscache_entry_create(struct Curl_easy *data,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr1,
- struct Curl_addrinfo **paddr2,
- const char *hostname,
- size_t hostlen,
- uint16_t port,
- bool permanent)
+static struct Curl_dns_entry *dnscache_entry_create(
+ struct Curl_easy *data,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr1,
+ struct Curl_addrinfo **paddr2,
+ const char *hostname,
+ size_t hostlen,
+ uint16_t port,
+ bool permanent)
{
struct Curl_dns_entry *dns = NULL;
return dns;
}
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry(struct Curl_easy *data,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr,
- const char *hostname,
- uint16_t port)
+struct Curl_dns_entry *Curl_dnscache_mk_entry(struct Curl_easy *data,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr,
+ const char *hostname,
+ uint16_t port)
{
return dnscache_entry_create(data, dns_queries, paddr, NULL, hostname,
hostname ? strlen(hostname) : 0,
port, FALSE);
}
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry2(struct Curl_easy *data,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr1,
- struct Curl_addrinfo **paddr2,
- const char *hostname,
- uint16_t port)
+struct Curl_dns_entry *Curl_dnscache_mk_entry2(struct Curl_easy *data,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr1,
+ struct Curl_addrinfo **paddr2,
+ const char *hostname,
+ uint16_t port)
{
return dnscache_entry_create(data, dns_queries, paddr1, paddr2, hostname,
hostname ? strlen(hostname) : 0,
}
#endif /* USE_HTTPSRR */
-static struct Curl_dns_entry *
-dnscache_add_addr(struct Curl_easy *data,
- struct Curl_dnscache *dnscache,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr,
- const char *hostname,
- size_t hlen,
- uint16_t port,
- bool permanent)
+static struct Curl_dns_entry *dnscache_add_addr(struct Curl_easy *data,
+ struct Curl_dnscache *dnscache,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr,
+ const char *hostname,
+ size_t hlen,
+ uint16_t port,
+ bool permanent)
{
char entry_id[MAX_HOSTCACHE_LEN];
size_t entry_len;
* Create a `Curl_dns_entry` with a reference count of 1.
* Use `Curl_dns_entry_unlink()` to release your hold on it.
*
- * The call takes ownership of `addr`, even in case of failure, and always
+ * The call takes ownership of `paddr`, even in case of failure, and always
* clears `*paddr`. It makes a copy of `hostname`.
*
* Returns entry or NULL on OOM.
*/
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry(struct Curl_easy *data,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr,
- const char *hostname,
- uint16_t port);
-
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry2(struct Curl_easy *data,
- uint8_t dns_queries,
- struct Curl_addrinfo **paddr1,
- struct Curl_addrinfo **paddr2,
- const char *hostname,
- uint16_t port);
+struct Curl_dns_entry *Curl_dnscache_mk_entry(struct Curl_easy *data,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr,
+ const char *hostname,
+ uint16_t port);
+
+struct Curl_dns_entry *Curl_dnscache_mk_entry2(struct Curl_easy *data,
+ uint8_t dns_queries,
+ struct Curl_addrinfo **paddr1,
+ struct Curl_addrinfo **paddr2,
+ const char *hostname,
+ uint16_t port);
#ifdef USE_HTTPSRR
void Curl_dns_entry_set_https_rr(struct Curl_dns_entry *dns,
void Curl_dns_entry_unlink(struct Curl_easy *data,
struct Curl_dns_entry **pdns);
-
struct Curl_dnscache {
struct Curl_hash entries;
};
return DOH_OK;
}
-UNITTEST void de_init(struct dohentry *d);
+UNITTEST void de_init(struct dohentry *de);
UNITTEST void de_init(struct dohentry *de)
{
int i;
return CURLE_OK;
}
+/* @unittest 1658 */
UNITTEST CURLcode doh_resp_decode_httpsrr(struct Curl_easy *data,
const unsigned char *cp, size_t len,
struct Curl_https_rrinfo **hrr);
-
-/* @unittest 1658 */
UNITTEST CURLcode doh_resp_decode_httpsrr(struct Curl_easy *data,
const unsigned char *cp, size_t len,
struct Curl_https_rrinfo **hrr)
__has_builtin() function, so override it. */
/* if GCC on i386/x86_64 or if the built-in is present */
-#if (defined(__GNUC__) && !defined(__clang__)) && \
- (defined(__i386__) || defined(__x86_64__))
+#if (defined(__GNUC__) && !defined(__clang__)) && \
+ (defined(__i386__) || defined(__x86_64__))
#define HAVE_BUILTIN_IA32_PAUSE
#elif defined(__has_builtin) /* Keep this PP check separate from others */
#if __has_builtin(__builtin_ia32_pause)
}
/* Iterates over available options */
-const struct curl_easyoption *
-curl_easy_option_next(const struct curl_easyoption *prev)
+const struct curl_easyoption *curl_easy_option_next(
+ const struct curl_easyoption *prev)
{
if(prev && prev->name) {
prev++;
return NULL;
}
-const struct curl_easyoption *
-curl_easy_option_next(const struct curl_easyoption *prev)
+const struct curl_easyoption *curl_easy_option_next(
+ const struct curl_easyoption *prev)
{
(void)prev;
return NULL;
ftpc->file = fileName;
else
ftpc->file = NULL; /* instead of point to a zero byte,
- we make it a NULL pointer */
+ we make it a NULL pointer */
if(data->state.upload && !ftpc->file && (ftp->transfer == PPTRANSFER_BODY)) {
/* We need a filename when uploading. Return error! */
if((data->state.resume_from && !sizechecked) ||
((data->state.resume_from > 0) && sizechecked)) {
- /* we are about to continue the uploading of a file */
- /* 1. get already existing file's size. We use the SIZE command for this
- which may not exist in the server! The SIZE command is not in
- RFC959. */
+ /* we are about to continue the uploading of a file
+ 1. get already existing file's size. We use the SIZE command for this
+ which may not exist in the server! The SIZE command is not in
+ RFC959.
- /* 2. This used to set REST, but since we can do append, we issue no
- another ftp command. Skip the source file offset and APPEND the rest on
- the file instead */
+ 2. This used to set REST, but since we can do append, we issue no
+ another ftp command. Skip the source file offset and APPEND the rest
+ on the file instead
- /* 3. pass file-size number of bytes in the source file */
- /* 4. lower the infilesize counter */
+ 3. pass file-size number of bytes in the source file
+ 4. lower the infilesize counter */
/* => transfer as usual */
int seekerr = CURL_SEEKFUNC_OK;
/*
* Unittest @1668
*/
-
UNITTEST bool ftp_213_date(const char *p, int *year, int *month, int *day,
int *hour, int *minute, int *second);
UNITTEST bool ftp_213_date(const char *p, int *year, int *month, int *day,
* This is the actual DO function for FTP. Get a file/directory according to
* the options previously setup.
*/
-static
-CURLcode ftp_perform(struct Curl_easy *data,
- struct ftp_conn *ftpc,
- struct FTP *ftp,
- bool *connected, /* connect status after PASV / PORT */
- bool *dophase_done)
+static CURLcode ftp_perform(
+ struct Curl_easy *data,
+ struct ftp_conn *ftpc,
+ struct FTP *ftp,
+ bool *connected, /* connect status after PASV / PORT */
+ bool *dophase_done)
{
/* this is FTP and no proxy */
CURLcode result = CURLE_OK;
/* filter pattern-corresponding filenames */
Curl_set_in_callback(data, TRUE);
- if(compare(data->set.fnmatch_data, wc->pattern,
- finfo->filename) == 0) {
+ if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) {
/* discard symlink which is containing multiple " -> " */
if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target &&
(strstr(finfo->strings.target, " -> "))) {
#endif
}
-struct Curl_hash_element *
-Curl_hash_next_element(struct Curl_hash_iterator *iter)
+struct Curl_hash_element *Curl_hash_next_element(
+ struct Curl_hash_iterator *iter)
{
struct Curl_hash *h;
DEBUGASSERT(iter->init == ITERINIT);
size_t key2_len);
void Curl_hash_start_iterate(struct Curl_hash *hash,
struct Curl_hash_iterator *iter);
-struct Curl_hash_element *
-Curl_hash_next_element(struct Curl_hash_iterator *iter);
+struct Curl_hash_element *Curl_hash_next_element(
+ struct Curl_hash_iterator *iter);
void Curl_hash_print(struct Curl_hash *h, void (*func)(void *));
***************************************************************************/
#include "curl_setup.h"
-#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \
- !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \
+#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \
+ !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \
defined(USE_SSL)
#include "curl_hmac.h"
/* Update the digest with the given challenge */
do {
- unsigned int ilen = (unsigned int) CURLMIN(datalen, UINT_MAX);
+ unsigned int ilen = (unsigned int)CURLMIN(datalen, UINT_MAX);
Curl_HMAC_update(ctxt, data, ilen);
datalen -= ilen;
data += ilen;
* CURLRES_* defines based on the config*.h and curl_setup.h defines.
*/
-/*
- * Curl_printable_address() stores a printable version of the 1st address
- * given in the 'ai' argument. The result will be stored in the buf that is
- * bufsize bytes big.
- *
- * If the conversion fails, the target buffer is empty.
- */
-
uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
{
(void)data;
return CURL_DNSQ_A;
default:
if(Curl_ipv6works(data))
- return (CURL_DNSQ_A|CURL_DNSQ_AAAA);
+ return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
else
return CURL_DNSQ_A;
}
const char *Curl_resolv_query_str(uint8_t dns_queries)
{
switch(dns_queries) {
- case (CURL_DNSQ_A|CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
+ case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
return "A+AAAA+HTTPS";
- case (CURL_DNSQ_A|CURL_DNSQ_AAAA):
+ case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
return "A+AAAA";
- case (CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
+ case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
return "AAAA+HTTPS";
case (CURL_DNSQ_AAAA):
return "AAAA";
- case (CURL_DNSQ_A|CURL_DNSQ_HTTPS):
+ case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
return "A+HTTPS";
case (CURL_DNSQ_A):
return "A";
}
#endif
+/*
+ * Curl_printable_address() stores a printable version of the 1st address
+ * given in the 'ai' argument. The result will be stored in the buf that is
+ * bufsize bytes big.
+ *
+ * If the conversion fails, the target buffer is empty.
+ */
void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf,
size_t bufsize)
{
}
#ifdef USE_CURL_ASYNC
-static struct Curl_resolv_async *
-hostip_async_new(struct Curl_easy *data,
- uint8_t dns_queries,
- const char *hostname,
- uint16_t port,
- uint8_t transport,
- timediff_t timeout_ms)
+static struct Curl_resolv_async *hostip_async_new(struct Curl_easy *data,
+ uint8_t dns_queries,
+ const char *hostname,
+ uint16_t port,
+ uint8_t transport,
+ timediff_t timeout_ms)
{
struct Curl_resolv_async *async;
size_t hostlen = strlen(hostname);
return result;
}
-const struct Curl_addrinfo *
-Curl_resolv_get_ai(struct Curl_easy *data, uint32_t resolv_id,
- int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
+ uint32_t resolv_id,
+ int ai_family,
+ unsigned int index)
{
#ifdef CURLRES_ASYNCH
struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
timeout_ms, TRUE, presolv_id, entry);
}
-
#ifdef USE_CURL_ASYNC
struct Curl_resolv_async *Curl_async_get(struct Curl_easy *data,
#define CURL_DNSQ_AAAA (1U << 1)
#define CURL_DNSQ_HTTPS (1U << 2)
-#define CURL_DNSQ_ALL (CURL_DNSQ_A|CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS)
-#define CURL_DNSQ_IP(x) (uint8_t)((x)&(CURL_DNSQ_A|CURL_DNSQ_AAAA))
+#define CURL_DNSQ_ALL (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS)
+#define CURL_DNSQ_IP(x) (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
#ifdef CURLVERBOSE
const char *Curl_resolv_query_str(uint8_t dns_queries);
/*
* Curl_printable_address() returns a printable version of the 1st address
- * given in the 'ip' argument. The result will be stored in the buf that is
+ * given in the 'ai' argument. The result will be stored in the buf that is
* bufsize bytes big.
*/
-void Curl_printable_address(const struct Curl_addrinfo *ip,
+void Curl_printable_address(const struct Curl_addrinfo *ai,
char *buf, size_t bufsize);
/* Start DNS resolving for the given parameters. Returns
void Curl_resolv_destroy(struct Curl_easy *data, uint32_t resolv_id);
-const struct Curl_addrinfo *
-Curl_resolv_get_ai(struct Curl_easy *data, uint32_t resolv_id,
- int ai_family, unsigned int index);
+const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
+ uint32_t resolv_id,
+ int ai_family,
+ unsigned int index);
#ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_resolv_get_https(struct Curl_easy *data, uint32_t resolv_id);
+const struct Curl_https_rrinfo *Curl_resolv_get_https(struct Curl_easy *data,
+ uint32_t resolv_id);
bool Curl_resolv_knows_https(struct Curl_easy *data, uint32_t resolv_id);
#endif /* USE_HTTPSRR */
-#else /* USE_CURL_ASYNC */
-#define Curl_resolv_shutdown_all(x) Curl_nop_stmt
-#define Curl_resolv_destroy_all(x) Curl_nop_stmt
+#else /* !USE_CURL_ASYNC */
+#define Curl_resolv_shutdown_all(x) Curl_nop_stmt
+#define Curl_resolv_destroy_all(x) Curl_nop_stmt
#define Curl_resolv_take_result(x, y, z) CURLE_NOT_BUILT_IN
-#define Curl_resolv_get_ai(x,y,z, a) NULL
-#define Curl_resolv_get_https(x,y) NULL
-#define Curl_resolv_knows_https(x,y) TRUE
-#define Curl_resolv_pollset(x,y) CURLE_OK
-#define Curl_resolv_destroy(x,y) Curl_nop_stmt
-#endif /* USE_CURL_ASYNC, else */
+#define Curl_resolv_get_ai(x, y, z, a) NULL
+#define Curl_resolv_get_https(x, y) NULL
+#define Curl_resolv_knows_https(x, y) TRUE
+#define Curl_resolv_pollset(x, y) CURLE_OK
+#define Curl_resolv_destroy(x, y) Curl_nop_stmt
+#endif /* USE_CURL_ASYNC */
CURLcode Curl_resolver_error(struct Curl_easy *data, const char *detail);
#endif /* CURLRES_IPV4 */
#if defined(CURLRES_IPV4) && !defined(USE_RESOLV_ARES) && \
- !defined(CURLRES_AMIGA)
+ !defined(CURLRES_AMIGA)
/*
* Curl_ipv4_resolve_r() - ipv4 thread-safe resolver function.
DEBUGASSERT(data->conn);
/*
- ** If we have not been asked to fail on error,
- ** do not fail.
- */
+ * If we have not been asked to fail on error,
+ * do not fail.
+ */
if(!data->set.http_fail_on_error)
return FALSE;
/*
- ** Any code < 400 is never terminal.
- */
+ * Any code < 400 is never terminal.
+ */
if(httpcode < 400)
return FALSE;
/*
- ** A 416 response to a resume request is presumably because the file is
- ** already completely downloaded and thus not actually a fail.
- */
+ * A 416 response to a resume request is presumably because the file is
+ * already completely downloaded and thus not actually a fail.
+ */
if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
httpcode == 416)
return FALSE;
/*
- ** Any code >= 400 that is not 401 or 407 is always
- ** a terminal error
- */
+ * Any code >= 400 that is not 401 or 407 is always
+ * a terminal error
+ */
if((httpcode != 401) && (httpcode != 407))
return TRUE;
/*
- ** All we have left to deal with is 401 and 407
- */
+ * All we have left to deal with is 401 and 407
+ */
DEBUGASSERT((httpcode == 401) || (httpcode == 407));
/*
- ** Examine the current authentication state to see if this is an error. The
- ** idea is for this function to get called after processing all the headers
- ** in a response message. If we have been to asked to authenticate
- ** a particular stage, and we have done it, we are OK. If we are already
- ** completely authenticated, it is not OK to get another 401 or 407.
- **
- ** It is possible for authentication to go stale such that the client needs
- ** to reauthenticate. Once that info is available, use it here.
- */
+ * Examine the current authentication state to see if this is an error. The
+ * idea is for this function to get called after processing all the headers
+ * in a response message. If we have been to asked to authenticate
+ * a particular stage, and we have done it, we are OK. If we are already
+ * completely authenticated, it is not OK to get another 401 or 407.
+ *
+ * It is possible for authentication to go stale such that the client needs
+ * to reauthenticate. Once that info is available, use it here.
+ */
/*
- ** Either we are not authenticating, or we are supposed to be authenticating
- ** something else. This is an error.
- */
+ * Either we are not authenticating, or we are supposed to be authenticating
+ * something else. This is an error.
+ */
if((httpcode == 401) && !data->state.aptr.user)
return TRUE;
#ifndef CURL_DISABLE_PROXY
*
* @returns CURLcode
*/
-CURLcode
-Curl_http_output_auth(struct Curl_easy *data,
- struct connectdata *conn,
- const char *request,
- Curl_HttpReq httpreq,
- const char *path,
- bool proxytunnel) /* TRUE if this is the request setting
- up the proxy tunnel */
+CURLcode Curl_http_output_auth(struct Curl_easy *data,
+ struct connectdata *conn,
+ const char *request,
+ Curl_HttpReq httpreq,
+ const char *path,
+ bool proxytunnel) /* TRUE if this is
+ the request setting up
+ the proxy tunnel */
{
CURLcode result = CURLE_OK;
struct auth *authhost;
/* We are now waiting for a reply from the server or
* a timeout on our side IFF the request has been fully sent. */
DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, "
- "timeout %dms", data->set.expect_100_timeout));
+ "timeout %dms", data->set.expect_100_timeout));
ctx->state = EXP100_AWAITING_CONTINUE;
ctx->start = *Curl_pgrs_now(data);
Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT);
#endif
}
#else
-#define http_check_auth_closure(x,y) /* empty */
+#define http_check_auth_closure(x, y) /* empty */
#endif
/*
result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
if(!result && is_eos) {
- result = Curl_client_write(data, (CLIENTWRITE_BODY|CLIENTWRITE_EOS),
+ result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
&tmp, 0);
}
return result;
*
* @returns CURLcode
*/
-CURLcode
-Curl_http_output_auth(struct Curl_easy *data,
- struct connectdata *conn,
- const char *request,
- Curl_HttpReq httpreq,
- const char *path,
- bool proxytunnel); /* TRUE if this is the request setting
- up the proxy tunnel */
+CURLcode Curl_http_output_auth(struct Curl_easy *data,
+ struct connectdata *conn,
+ const char *request,
+ Curl_HttpReq httpreq,
+ const char *path,
+ bool proxytunnel); /* TRUE if this is
+ the request setting up
+ the proxy tunnel */
/* Decode HTTP status code string. */
CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len);
break;
curlx_dyn_reset(&dbuf);
result = curlx_dyn_addf(&dbuf, "%.*s: %.*s\x0d\x0a",
- (int)e->namelen, e->name,
- (int)e->valuelen, e->value);
+ (int)e->namelen, e->name,
+ (int)e->valuelen, e->value);
if(result)
break;
Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&dbuf),
}
UNITTEST CURLcode canon_path(const char *q, size_t len,
- struct dynbuf *new_path, bool normalize);
+ struct dynbuf *new_path,
+ bool do_uri_encode);
UNITTEST CURLcode canon_path(const char *q, size_t len,
struct dynbuf *new_path,
bool do_uri_encode)
size_t trlen = curlx_dyn_len(&ch->trailer);
if(cw_next)
result = Curl_cwriter_write(data, cw_next,
- CLIENTWRITE_HEADER|
+ CLIENTWRITE_HEADER |
CLIENTWRITE_TRAILER,
tr, trlen);
else
result = Curl_client_write(data,
- CLIENTWRITE_HEADER|
+ CLIENTWRITE_HEADER |
CLIENTWRITE_TRAILER,
tr, trlen);
if(result) {
}
#else
-#define httpsrr_report_addr(a,b,c,d) Curl_nop_stmt
+#define httpsrr_report_addr(a, b, c, d) Curl_nop_stmt
#endif /* CURLVERBOSE */
CURLcode Curl_httpsrr_set(struct Curl_https_rrinfo *hi,
return result;
}
-struct Curl_https_rrinfo *
-Curl_httpsrr_dup_move(struct Curl_https_rrinfo *rrinfo)
+struct Curl_https_rrinfo *Curl_httpsrr_dup_move(
+ struct Curl_https_rrinfo *rrinfo)
{
struct Curl_https_rrinfo *dup = curlx_memdup(rrinfo, sizeof(*rrinfo));
if(dup)
CURLcode Curl_httpsrr_set(struct Curl_https_rrinfo *hi,
uint16_t rrkey, const uint8_t *val, size_t vlen);
-struct Curl_https_rrinfo *
-Curl_httpsrr_dup_move(struct Curl_https_rrinfo *rrinfo);
+struct Curl_https_rrinfo *Curl_httpsrr_dup_move(
+ struct Curl_https_rrinfo *rrinfo);
void Curl_httpsrr_cleanup(struct Curl_https_rrinfo *rrinfo);
void Curl_httpsrr_trace(struct Curl_easy *data,
struct Curl_https_rrinfo *hi);
#else
-#define Curl_httpsrr_trace(a,b) Curl_nop_stmt
+#define Curl_httpsrr_trace(a, b) Curl_nop_stmt
#endif
#endif /* USE_HTTPSRR */
#include <idn2.h>
#if defined(_WIN32) && defined(UNICODE)
-#define IDN2_LOOKUP(name, host, flags) \
+#define IDN2_LOOKUP(name, host, flags) \
idn2_lookup_u8((const uint8_t *)name, (uint8_t **)host, flags)
#else
-#define IDN2_LOOKUP(name, host, flags) \
+#define IDN2_LOOKUP(name, host, flags) \
idn2_lookup_ul((const char *)(name), (char **)(host), flags)
#endif
#endif /* USE_LIBIDN2 */
/* OpenSSL 3.0.0 marks the MD4 functions as deprecated */
#define OPENSSL_NO_MD4
#else
-/* Cover also OPENSSL_NO_MD4 configured in openssl */
+/* Cover also OPENSSL_NO_MD4 configured in OpenSSL */
#include <openssl/opensslconf.h>
#endif
#endif /* USE_OPENSSL */
result = my_md5_init(&ctx);
if(!result) {
do {
- unsigned int ilen = (unsigned int) CURLMIN(len, UINT_MAX);
+ unsigned int ilen = (unsigned int)CURLMIN(len, UINT_MAX);
my_md5_update(&ctx, input, ilen);
input += ilen;
len -= ilen;
case 0:
if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
failf(data, "client mime read EOF fail, "
- "only %"FMT_OFF_T"/%"FMT_OFF_T
+ "only %" FMT_OFF_T "/%" FMT_OFF_T
" of needed bytes read", ctx->read_len, ctx->total_len);
return CURLE_READ_ERROR;
}
}
CURL_TRC_READ(data, "cr_mime_read(len=%zu, total=%" FMT_OFF_T
- ", read=%"FMT_OFF_T") -> %d, %zu, %d",
+ ", read=%" FMT_OFF_T ") -> %d, %zu, %d",
blen, ctx->total_len, ctx->read_len, result, *pnread, *peos);
return result;
}
/* Upper-case digits. */
const unsigned char Curl_udigits[] = "0123456789ABCDEF";
-#define OUTCHAR(x) \
- do { \
- if(stream((unsigned char)(x), userp)) \
- return TRUE; \
- (*donep)++; \
+#define OUTCHAR(x) \
+ do { \
+ if(stream((unsigned char)(x), userp)) \
+ return TRUE; \
+ (*donep)++; \
} while(0)
/* Data type to read from the arglist */
#define CURL_MULTI_HANDLE 0x000bab1e
-
#ifdef DEBUGBUILD
/* On a debug build, we want to fail hard on multi handles that
* are not NULL, but no longer have the MAGIC touch. This gives
data->progress.deliver += delta;
}
-
void Curl_pgrs_download_inc(struct Curl_easy *data, size_t delta)
{
if(delta) {
const struct Curl_scheme Curl_scheme_smbs = {
"smbs", /* scheme */
-#if defined(CURL_ENABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \
- defined(USE_SSL)
+#if defined(CURL_ENABLE_SMB) && defined(USE_CURL_NTLM_CORE) && defined(USE_SSL)
&Curl_protocol_smb,
#else
ZERO_NULL,
const struct Curl_scheme Curl_scheme_wss = {
"wss", /* scheme */
#if defined(CURL_DISABLE_WEBSOCKETS) || defined(CURL_DISABLE_HTTP) || \
- !defined(USE_SSL)
+ !defined(USE_SSL)
ZERO_NULL,
#else
&Curl_protocol_ws,
/* Low level request receive/send io_flags checks. */
#define CURL_REQ_WANT_SEND(d) ((d)->req.io_flags & REQ_IO_SEND)
#define CURL_REQ_WANT_RECV(d) ((d)->req.io_flags & REQ_IO_RECV)
-#define CURL_REQ_WANT_IO(d) ((d)->req.io_flags & (REQ_IO_RECV|REQ_IO_SEND))
+#define CURL_REQ_WANT_IO(d) \
+ ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
/* Low level request receive/send io_flags manipulations. */
-#define CURL_REQ_SET_SEND(d) ((d)->req.io_flags |= REQ_IO_SEND)
-#define CURL_REQ_SET_RECV(d) ((d)->req.io_flags |= REQ_IO_RECV)
+#define CURL_REQ_SET_SEND(d) ((d)->req.io_flags |= REQ_IO_SEND)
+#define CURL_REQ_SET_RECV(d) ((d)->req.io_flags |= REQ_IO_RECV)
#define CURL_REQ_CLEAR_SEND(d) \
((d)->req.io_flags &= (uint8_t)~REQ_IO_SEND)
#define CURL_REQ_CLEAR_RECV(d) \
((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
#define CURL_REQ_CLEAR_IO(d) \
- ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV|REQ_IO_SEND))
+ ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
enum expect100 {
EXP100_SEND_DATA, /* enough waiting, send the body now */
/* As stated in the http comments, it is probably not wise to
* actually set a custom Content-Length in the headers */
if(!Curl_checkheaders(data, STRCONST("Content-Length"))) {
- result = curlx_dyn_addf(reqp, "Content-Length: %" FMT_OFF_T"\r\n",
+ result = curlx_dyn_addf(reqp, "Content-Length: %" FMT_OFF_T "\r\n",
req_clen);
if(result)
return result;
if(ufds[i].fd == CURL_SOCKET_BAD)
continue;
VERIFY_SOCK(ufds[i].fd);
- if(ufds[i].events & (POLLIN |POLLOUT |POLLPRI |
+ if(ufds[i].events & (POLLIN | POLLOUT | POLLPRI |
POLLRDNORM | POLLWRNORM | POLLRDBAND)) {
if(ufds[i].fd > maxfd)
maxfd = ufds[i].fd;
bool do_in, bool do_out)
{
return Curl_pollset_change(data, ps, sock,
- (do_in ? CURL_POLL_IN : 0)|
+ (do_in ? CURL_POLL_IN : 0) |
(do_out ? CURL_POLL_OUT : 0),
- (!do_in ? CURL_POLL_IN : 0)|
+ (!do_in ? CURL_POLL_IN : 0) |
(!do_out ? CURL_POLL_OUT : 0));
}
* Definition of pollfd struct and constants for platforms lacking them.
*/
-#if !defined(HAVE_SYS_POLL_H) && \
- !defined(HAVE_POLL_H) && \
- !defined(POLLIN)
+#if !defined(HAVE_SYS_POLL_H) && !defined(HAVE_POLL_H) && !defined(POLLIN)
#define POLLIN 0x01
#define POLLPRI 0x02
The bit pattern defines to what "streams" to write to. Body and/or header.
The defines are in sendf.h of course.
*/
-CURLcode Curl_client_write(struct Curl_easy *data,
- int type, const char *buf, size_t len)
+CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf,
+ size_t len)
{
CURLcode result;
case 0:
if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
failf(data, "client read function EOF fail, "
- "only %"FMT_OFF_T"/%"FMT_OFF_T " of needed bytes read",
+ "only %" FMT_OFF_T "/%" FMT_OFF_T " of needed bytes read",
ctx->read_len, ctx->total_len);
result = CURLE_READ_ERROR;
break;
*peos = (bool)ctx->seen_eos;
break;
}
- CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%"FMT_OFF_T
- ", read=%"FMT_OFF_T") -> %d, nread=%zu, eos=%d",
+ CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%" FMT_OFF_T
+ ", read=%" FMT_OFF_T ") -> %d, nread=%zu, eos=%d",
blen, ctx->total_len, ctx->read_len, result,
*pnread, *peos);
return result;
cl_reset_reader(data);
result = do_init_reader_stack(data, r);
out:
- CURL_TRC_READ(data, "add fread reader, len=%"FMT_OFF_T " -> %d",
+ CURL_TRC_READ(data, "add fread reader, len=%" FMT_OFF_T " -> %d",
len, result);
return result;
}
/* GSSAPI wrappers. */
-extern OM_uint32 Curl_gss_import_name_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_import_name_a(OM_uint32 *minor_status,
gss_buffer_t in_name,
gss_OID in_name_type,
- gss_name_t * out_name);
+ gss_name_t *out_name);
#define gss_import_name Curl_gss_import_name_a
-extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_display_status_a(OM_uint32 *minor_status,
OM_uint32 status_value,
int status_type, gss_OID mech_type,
- gss_msg_ctx_t * message_context,
+ gss_msg_ctx_t *message_context,
gss_buffer_t status_string);
#define gss_display_status Curl_gss_display_status_a
-extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 *minor_status,
gss_cred_id_t cred_handle,
- gss_ctx_id_t * context_handle,
+ gss_ctx_id_t *context_handle,
gss_name_t target_name,
gss_OID mech_type,
gss_flags_t req_flags,
gss_channel_bindings_t
input_chan_bindings,
gss_buffer_t input_token,
- gss_OID * actual_mech_type,
+ gss_OID *actual_mech_type,
gss_buffer_t output_token,
- gss_flags_t * ret_flags,
- OM_uint32 * time_rec);
+ gss_flags_t *ret_flags,
+ OM_uint32 *time_rec);
#define gss_init_sec_context Curl_gss_init_sec_context_a
extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
(a)[0] = (unsigned char)((((unsigned long)(val)) >> 24) & 0xff); \
(a)[1] = (unsigned char)((((unsigned long)(val)) >> 16) & 0xff); \
(a)[2] = (unsigned char)((((unsigned long)(val)) >> 8) & 0xff); \
- (a)[3] = (unsigned char) (((unsigned long)(val)) & 0xff); \
+ (a)[3] = (unsigned char)(((unsigned long)(val)) & 0xff); \
} while(0)
#define WPA_PUT_BE64(a, val) \
result = my_sha256_init(&ctx);
if(!result) {
do {
- unsigned int ilen = (unsigned int) CURLMIN(len, UINT_MAX);
+ unsigned int ilen = (unsigned int)CURLMIN(len, UINT_MAX);
my_sha256_update(&ctx, input, ilen);
len -= ilen;
input += ilen;
CURLcode Curl_wakeup_consume(curl_socket_t socks[2], bool all);
#else
-#define Curl_wakeup_destroy(x) Curl_nop_stmt
+#define Curl_wakeup_destroy(x) Curl_nop_stmt
#endif
#endif /* HEADER_CURL_SOCKETPAIR_H */
if(gss_major_status != GSS_S_CONTINUE_NEEDED)
break;
- /* analyse response */
+ /* analyze response */
/* GSS-API response looks like
* +----+------+-----+----------------+
#ifdef USE_WINSOCK
/* We want to wait for both stdin and the socket. Since
- ** the select() function in Winsock only works on sockets
- ** we have to use the WaitForMultipleObjects() call.
- */
+ * the select() function in Winsock only works on sockets
+ * we have to use the WaitForMultipleObjects() call.
+ */
/* First, create a sockets event object */
event_handle = WSACreateEvent();
#define CURL_UINT32_SPBSET_MAGIC 0x70737362
#endif
-/* Clear the bitset, making it empty. */
-UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset);
-
void Curl_uint32_spbset_init(struct uint32_spbset *bset)
{
memset(bset, 0, sizeof(*bset));
#endif
}
+/* Clear the bitset, making it empty. */
+UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset);
+UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset)
+{
+ struct uint32_spbset_chunk *next, *chunk;
+
+ for(chunk = bset->head.next; chunk; chunk = next) {
+ next = chunk->next;
+ curlx_free(chunk);
+ }
+ memset(&bset->head, 0, sizeof(bset->head));
+}
+
void Curl_uint32_spbset_destroy(struct uint32_spbset *bset)
{
DEBUGASSERT(bset->init == CURL_UINT32_SPBSET_MAGIC);
return n;
}
-UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset)
-{
- struct uint32_spbset_chunk *next, *chunk;
-
- for(chunk = bset->head.next; chunk; chunk = next) {
- next = chunk->next;
- curlx_free(chunk);
- }
- memset(&bset->head, 0, sizeof(bset->head));
-}
-
-static struct uint32_spbset_chunk *
-uint32_spbset_get_chunk(struct uint32_spbset *bset, uint32_t i, bool grow)
+static struct uint32_spbset_chunk *uint32_spbset_get_chunk(
+ struct uint32_spbset *bset, uint32_t i, bool grow)
{
struct uint32_spbset_chunk *chunk, **panchor = NULL;
uint32_t i_offset = (i & ~CURL_UINT32_SPBSET_CH_MASK);
#define CURL_UINT32_TBL_MAGIC 0x62757473
#endif
-/* Clear the table, making it empty. */
-UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl);
-
void Curl_uint32_tbl_init(struct uint32_tbl *tbl,
Curl_uint32_tbl_entry_dtor *entry_dtor)
{
return CURLE_OK;
}
-void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl)
-{
- DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
- Curl_uint32_tbl_clear(tbl);
- curlx_free(tbl->rows);
- memset(tbl, 0, sizeof(*tbl));
-}
-
+/* Clear the table, making it empty. */
+UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl);
UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl)
{
DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
tbl->last_key_added = UINT32_MAX;
}
+void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl)
+{
+ DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
+ Curl_uint32_tbl_clear(tbl);
+ curlx_free(tbl->rows);
+ memset(tbl, 0, sizeof(*tbl));
+}
+
uint32_t Curl_uint32_tbl_capacity(struct uint32_tbl *tbl)
{
return tbl->nrows;
#endif
set->new_file_perms = 0644; /* Default permissions */
- set->allowed_protocols = (curl_prot_t) CURLPROTO_64ALL;
+ set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
set->redir_protocols = CURLPROTO_REDIR;
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
/**
* Always eval all arguments, return the first
- * result != (CURLE_OK|CURLE_AGAIN) or `r1`.
+ * result != (CURLE_OK | CURLE_AGAIN) or `r1`.
*/
CURLcode Curl_1st_fatal(CURLcode r1, CURLcode r2);
CURLUcode Curl_junkscan(const char *url, size_t *urllen, bool allowspace);
-#define U_CURLU_URLDECODE (unsigned int)CURLU_URLDECODE
+#define U_CURLU_URLDECODE (unsigned int)CURLU_URLDECODE
#define U_CURLU_PATH_AS_IS (unsigned int)CURLU_PATH_AS_IS
#endif /* HEADER_CURL_URLAPI_INT_H */
/* This file is for lib internal stuff */
#include "curl_setup.h"
-#define CURL_DEFAULT_USER "anonymous"
+#define CURL_DEFAULT_USER "anonymous"
#define CURL_DEFAULT_PASSWORD "ftp@example.com"
#if !defined(_WIN32) && !defined(MSDOS)
#endif
#ifdef HAVE_GSSAPI
#ifdef HAVE_GSSGNU
- curl_msnprintf(gss_buf, sizeof(gss_buf), "libgss/%s",
- GSS_VERSION);
+ curl_msnprintf(gss_buf, sizeof(gss_buf), "libgss/%s", GSS_VERSION);
#elif defined(CURL_KRB5_VERSION)
- curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5/%s",
- CURL_KRB5_VERSION);
+ curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5/%s", CURL_KRB5_VERSION);
#else
curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5");
#endif
FEATURE("alt-svc", NULL, CURL_VERSION_ALTSVC),
#endif
#if defined(USE_ARES) && defined(USE_RESOLV_THREADED) && defined(USE_HTTPSRR)
- FEATURE("asyn-rr", NULL, 0),
+ FEATURE("asyn-rr", NULL, 0),
#endif
#ifdef CURLRES_ASYNCH
FEATURE("AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS),
rc = ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_MD5, &hash, &hlen);
if(rc != SSH_OK || hlen != 16) {
failf(data,
- "Denied establishing ssh session: md5 fingerprint not available");
+ "Denied establishing ssh session: MD5 fingerprint not available");
goto cleanup;
}
if(!curl_strequal(md5buffer, pubkey_md5)) {
failf(data,
- "Denied establishing ssh session: mismatch md5 fingerprint. "
+ "Denied establishing ssh session: mismatch MD5 fingerprint. "
"Remote %s is not equal to %s", md5buffer, pubkey_md5);
rc = SSH_ERROR;
goto cleanup;
LIBSSH2_HOSTKEY_HASH_SHA256);
if(!fingerprint) {
failf(data,
- "Denied establishing ssh session: sha256 fingerprint "
+ "Denied establishing ssh session: SHA256 fingerprint "
"not available");
myssh_to(data, sshc, SSH_SESSION_FREE);
return CURLE_PEER_FAILED_VERIFICATION;
}
if(!fingerprint_b64) {
- failf(data, "sha256 fingerprint could not be encoded");
+ failf(data, "SHA256 fingerprint could not be encoded");
myssh_to(data, sshc, SSH_SESSION_FREE);
return CURLE_PEER_FAILED_VERIFICATION;
}
b64_pos++;
}
- /* Before we authenticate we check the hostkey's sha256 fingerprint
+ /* Before we authenticate we check the hostkey's SHA256 fingerprint
* against a known fingerprint, if available.
*/
if((pub_pos != b64_pos) ||
strncmp(fingerprint_b64, pubkey_sha256, pub_pos)) {
failf(data,
- "Denied establishing ssh session: mismatch sha256 fingerprint. "
+ "Denied establishing ssh session: mismatch SHA256 fingerprint. "
"Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256);
curlx_free(fingerprint_b64);
myssh_to(data, sshc, SSH_SESSION_FREE);
if(!fingerprint || !curl_strequal(md5buffer, pubkey_md5)) {
if(fingerprint) {
failf(data,
- "Denied establishing ssh session: mismatch md5 fingerprint. "
+ "Denied establishing ssh session: mismatch MD5 fingerprint. "
"Remote %s is not equal to %s", md5buffer, pubkey_md5);
}
else {
failf(data,
- "Denied establishing ssh session: md5 fingerprint "
+ "Denied establishing ssh session: MD5 fingerprint "
"not available");
}
myssh_to(data, sshc, SSH_SESSION_FREE);
void Curl_tls_keylog_open(void)
{
- char *keylog_file_name;
-
if(!keylog_file_fp) {
- keylog_file_name = curl_getenv("SSLKEYLOGFILE");
+ char *keylog_file_name = curl_getenv("SSLKEYLOGFILE");
if(keylog_file_name) {
keylog_file_fp = curlx_fopen(keylog_file_name, FOPEN_APPENDTEXT);
if(keylog_file_fp) {
/* Import certificates from the Windows root certificate store if
requested.
https://stackoverflow.com/questions/9507184/
- https://github.com/d3x0r/SACK/blob/master/src/netlib/ssl_layer.c#L1037
+ https://github.com/d3x0r/SACK/blob/ff15424d3c581b86d40f818532e5a400c516d39d/src/netlib/ssl_layer.c#L1410
https://datatracker.ietf.org/doc/html/rfc5280 */
const char *win_stores[] = {
"ROOT", /* Trusted Root Certification Authorities */
for(; i <= (ssl_version_max >> 16); ++i) {
switch(i) {
case CURL_SSLVERSION_TLSv1_0:
- (*enabled_protocols) |= SP_PROT_TLS1_0_CLIENT;
+ *enabled_protocols |= SP_PROT_TLS1_0_CLIENT;
break;
case CURL_SSLVERSION_TLSv1_1:
- (*enabled_protocols) |= SP_PROT_TLS1_1_CLIENT;
+ *enabled_protocols |= SP_PROT_TLS1_1_CLIENT;
break;
case CURL_SSLVERSION_TLSv1_2:
- (*enabled_protocols) |= SP_PROT_TLS1_2_CLIENT;
+ *enabled_protocols |= SP_PROT_TLS1_2_CLIENT;
break;
case CURL_SSLVERSION_TLSv1_3:
/* Windows Server 2022 and newer */
if(curlx_verify_windows_version(10, 0, 20348, PLATFORM_WINNT,
VERSION_GREATER_THAN_EQUAL)) {
- (*enabled_protocols) |= SP_PROT_TLS1_3_CLIENT;
+ *enabled_protocols |= SP_PROT_TLS1_3_CLIENT;
break;
}
else { /* Windows 10 and older */
return 0; /* not found */
}
-#define NUM_CIPHERS 47 /* There are 47 options listed above */
+#define NUM_CIPHERS 47 /* There are a maximum of 47 options listed above */
static CURLcode set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers,
ALG_ID *algIds)
struct Curl_cftype Curl_cft_ssl_proxy = {
"SSL-PROXY",
- CF_TYPE_SSL|CF_TYPE_PROXY,
+ CF_TYPE_SSL | CF_TYPE_PROXY,
CURL_LOG_LVL_NONE,
ssl_cf_destroy,
ssl_cf_connect,
*
* @unittest 1666
*/
-UNITTEST CURLcode encodeOID(struct dynbuf *buf, const char *b, const char *e);
+UNITTEST CURLcode encodeOID(struct dynbuf *store,
+ const char *beg, const char *end);
UNITTEST CURLcode encodeOID(struct dynbuf *store,
const char *beg, const char *end)
{
# else
struct Library *SocketBase = NULL;
# endif
-# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+# define select(a, b, c, d, e) WaitSelect(a, b, c, d, e, 0)
#endif
/* includes end */"
AC_CHECK_HEADERS(
}
# Build a single combined regex for removing whitelisted content
-my $re_wl;
my $pat = join('|', map { $_ } @whitelist);
-$re_wl = qr/($pat)/;
+my $re_wl = qr/($pat)/;
my $errors = 0;
my $numbugfixes = 0;
my $numcontributors = 0;
open(F, "<RELEASE-NOTES");
-my $mode=0;
+my $mode = 0;
while(<F>) {
if($_ =~ /following changes:/) {
$mode=1;
printf "Deleted files: %d (delta: %d)\n", $deletes,
$creates - $deletes;
print "Diffstat:$diffstat" if(!$fileschanged);
-printf "Files changed: %d (%.2f%%)\n", $fileschanged, $fileschanged*100/$afiles;
+printf "Files changed: %d (%.2f%%)\n", $fileschanged, $fileschanged * 100 / $afiles;
printf "Lines inserted: %d\n", $insertions;
printf "Lines deleted: %d (delta: %d)\n", $deletions,
$insertions - $deletions;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include <stddef.h>
#include "tool_setup.h"
+#include <stddef.h>
+
#include "tool_cfgable.h"
#include "tool_formparse.h"
#include "tool_libinfo.h"
static char *checkhome(const char *home, const char *fname, bool dotscore)
{
- const char pref[2] = { '.', '_' };
+ static const char pref[2] = { '.', '_' };
int i;
for(i = 0; i < (dotscore ? 2 : 1); i++) {
char *c;
{"dns-servers", ARG_STRG, ' ', C_DNS_SERVERS},
{"doh-cert-status", ARG_BOOL|ARG_TLS, ' ', C_DOH_CERT_STATUS},
{"doh-insecure", ARG_BOOL|ARG_TLS, ' ', C_DOH_INSECURE},
- {"doh-url" , ARG_STRG, ' ', C_DOH_URL},
+ {"doh-url", ARG_STRG, ' ', C_DOH_URL},
{"dump-ca-embed", ARG_NONE|ARG_TLS, ' ', C_DUMP_CA_EMBED},
{"dump-header", ARG_FILE, 'D', C_DUMP_HEADER},
{"ech", ARG_STRG|ARG_TLS, ' ', C_ECH},
{"proxy-ca-native", ARG_BOOL|ARG_TLS, ' ', C_PROXY_CA_NATIVE},
{"proxy-cacert", ARG_FILE|ARG_TLS, ' ', C_PROXY_CACERT},
{"proxy-capath", ARG_FILE|ARG_TLS, ' ', C_PROXY_CAPATH},
- {"proxy-cert", ARG_FILE|ARG_TLS|ARG_CLEAR, ' ', C_PROXY_CERT},
+ {"proxy-cert", ARG_FILE|ARG_TLS|ARG_CLEAR, ' ',
+ C_PROXY_CERT},
{"proxy-cert-type", ARG_STRG|ARG_TLS, ' ', C_PROXY_CERT_TYPE},
{"proxy-ciphers", ARG_STRG|ARG_TLS, ' ', C_PROXY_CIPHERS},
{"proxy-crlfile", ARG_FILE|ARG_TLS, ' ', C_PROXY_CRLFILE},
* the latter is not returned by curl_version_info(), it is built from
* the returned features bit mask.
*/
-
CURLcode get_libcurl_info(void)
{
CURLcode result = CURLE_OK;
* a given protocol and thus allows comparing pointers rather than strings.
* In addition, the returned pointer is not deallocated until the program ends.
*/
-
const char *proto_token(const char *proto)
{
const char * const *builtin;
/* We have written data to an output file, we truncate file */
fflush(outs->stream);
notef("Throwing away %" CURL_FORMAT_CURL_OFF_T " bytes", outs->bytes);
- /* truncate file at the position where we started appending */
+ /* truncate file at the position where we started appending */
if(toolx_ftruncate(fileno(outs->stream), outs->init)) {
/* when truncate fails, we cannot append as then we
create something strange, bail out */
}
#elif defined(__DJGPP__)
/*
- * Only supports 'off_t' (signed 32 bit) as file size.
+ * Only supports 'off_t' (signed 32-bit) as file size.
*/
int toolx_ftruncate_djgpp(int fd, curl_off_t where)
{
}
curl_multi_remove_handle(multi, msg->easy_handle);
curl_easy_cleanup(msg->easy_handle);
- curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
+ curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
"(%d now running)\n", xfer_id, running_handles);
}
}
curl_multi_remove_handle(multi, msg->easy_handle);
curl_easy_cleanup(msg->easy_handle);
--ongoing;
- curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
+ curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
"(%d now running)\n", xfer_id, running_handles);
}
}
0, 0, CURLUE_OK},
{"https://curl.se/# ",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20",
- CURLU_URLENCODE|CURLU_ALLOW_SPACE, 0, CURLUE_OK},
+ CURLU_URLENCODE | CURLU_ALLOW_SPACE, 0, CURLUE_OK},
{"", "", 0, 0, CURLUE_MALFORMED_INPUT},
{" ", "", 0, 0, CURLUE_MALFORMED_INPUT},
{"1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"https://user@example.net?hello# space ",
"https | user | [12] | [13] | example.net | [15] | / | hello | %20space%20",
- CURLU_ALLOW_SPACE|CURLU_URLENCODE, 0, CURLUE_OK},
+ CURLU_ALLOW_SPACE | CURLU_URLENCODE, 0, CURLUE_OK},
{"https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://example.com%252f%40@example.net",
"https | example.com%2f@ | [12] | [13] | example.net | [15] | / "
CURLU_DEFAULT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
/* no space allowed in scheme */
{"htt ps://user:password@example.net/get?this=and-what", "",
- CURLU_NON_SUPPORT_SCHEME|CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
+ CURLU_NON_SUPPORT_SCHEME | CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
{"https://user:password@example.net/get?this=and what",
"https | user | password | [13] | example.net | [15] | /get | "
"this=and what | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST},
{"boing:80",
"https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]",
- CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME, 0, CURLUE_OK},
+ CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME, 0, CURLUE_OK},
{"http://[fd00:a41::50]:8080",
"http | [11] | [12] | [13] | [fd00:a41::50] | 8080 | / | [16] | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
{"http://example.com/please/../gimme/%TESTNUMBER?foobar#hello",
"http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no",
"http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no",
- 0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
+ 0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
{"http://local.test?redirect=http://local.test:80?-321",
"http://local.test:80?-123",
"http://local.test:80/?-123",
- 0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
+ 0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
{"http://local.test?redirect=http://local.test:80?-321",
"http://local.test:80?-123",
"http://local.test:80/?-123",
{
CURLcode result = CURLE_OK;
CURLUcode rc;
- const char *schemes[] = {
+ static const char *schemes[] = {
"bad!", "bad{", "bad/", "bad\\", "a!",
"a+123", "http-2", "http.1",
"a+-.123", "http-+++2", "http.1--",
"ABC2", "2CBA", "", "a",
"aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd",
"aaaaaaaaaabbbbbbbbbbccccccccccdddddddddde",
- NULL};
+ NULL };
int i;
- (void) URL;
+ (void)URL;
global_init(CURL_GLOBAL_ALL);
/* Chains with only a single certificate are always in order */
if(cert_info->num_of_certs <= 1)
- return 1;
+ return true;
/* Enumerate each certificate in the chain */
for(cert = 0; cert < cert_info->num_of_certs; cert++) {
#if SIZEOF_TIME_T > 4
{ "2094 Nov 6 08:49:37", 3939871777 },
#endif
- { "01 Jan 2001 8:0:0", 978336000},
- { "01 Jan 2001 8:00:0", 978336000},
+ { "01 Jan 2001 8:0:0", 978336000 },
+ { "01 Jan 2001 8:00:0", 978336000 },
/* Out-of-range day-of-month Cases */
- { "29 Feb 2023 12:00:00 GMT", 1677672000},
- { "31 Apr 2024 12:00:00 GMT", 1714564800},
- { "30 Feb 2024 12:00:00 GMT", 1709294400},
- { "01-13-2024", -1},
- { "32 Jan 2024", -1},
- { "31 Jan 2024", 1706659200},
- { "32 Feb 2024", -1},
- { "32 Mar 2024", -1},
- { "32 Apr 2024", -1},
- { "32 May 2024", -1},
- { "32 Jun 2024", -1},
- { "32 Jul 2024", -1},
- { "32 Aug 2024", -1},
- { "32 Sep 2024", -1},
- { "32 Oct 2024", -1},
- { "32 Nov 2024", -1},
- { "32 Dec 2024", -1},
+ { "29 Feb 2023 12:00:00 GMT", 1677672000 },
+ { "31 Apr 2024 12:00:00 GMT", 1714564800 },
+ { "30 Feb 2024 12:00:00 GMT", 1709294400 },
+ { "01-13-2024", -1 },
+ { "32 Jan 2024", -1 },
+ { "31 Jan 2024", 1706659200 },
+ { "32 Feb 2024", -1 },
+ { "32 Mar 2024", -1 },
+ { "32 Apr 2024", -1 },
+ { "32 May 2024", -1 },
+ { "32 Jun 2024", -1 },
+ { "32 Jul 2024", -1 },
+ { "32 Aug 2024", -1 },
+ { "32 Sep 2024", -1 },
+ { "32 Oct 2024", -1 },
+ { "32 Nov 2024", -1 },
+ { "32 Dec 2024", -1 },
/* Timezone Offsets */
{ "Sun, 06 Nov 1994 08:49:37 +0530", 784091977 },
{ "Sun, 06 Nov 1994 08:49:37 +0545", 784091077 },
/* Y2K38 & Historical Boundaries */
#if SIZEOF_TIME_T > 4
/* for 32 bit time_t, we bail on >year 2037 */
- { "19 Jan 2038 03:14:07 GMT", 2147483647},
- { "19 Jan 2038 03:14:08 GMT", 2147483648},
- { "01 Jan 69 00:00:00 GMT", 3124224000},
+ { "19 Jan 2038 03:14:07 GMT", 2147483647 },
+ { "19 Jan 2038 03:14:08 GMT", 2147483648 },
+ { "01 Jan 69 00:00:00 GMT", 3124224000 },
#endif
- { "01 Jan 1500 00:00:00 GMT", -1},
+ { "01 Jan 1500 00:00:00 GMT", -1 },
/* Formatting & Malformed Junk */
- { "Sun, 06-Nov/1994 08:49:37", 784111777},
- { "Sun, 06 Nov 1994 08:49:37 GMT", 784111777},
- { " Sun, 06 Nov 1994 08:49:37 GMT ", 784111777},
- { "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1},
+ { "Sun, 06-Nov/1994 08:49:37", 784111777 },
+ { "Sun, 06 Nov 1994 08:49:37 GMT", 784111777 },
+ { " Sun, 06 Nov 1994 08:49:37 GMT ", 784111777 },
+ { "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1 },
/* wrong day name is ignored */
- { "Monday, 06 Nov 1994 08:49:37 GMT", 784111777},
+ { "Monday, 06 Nov 1994 08:49:37 GMT", 784111777 },
{ NULL, 0 }
};
curl_socket_t sockfd;
const struct curl_certinfo *certinfo;
struct curl_tlssessioninfo *tlssession;
- struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0};
+ struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0 };
CURLcode result = CURLE_OK;
(void)URL;
global_init(CURL_GLOBAL_ALL);
"${w3} curl_easy_setopt(curl, $name,";
my $ignoreset = "${w3}/* set string again to check for leaks */\n".
"${w3}(void)curl_easy_setopt(curl, $name,";
- my $i = ' ' x (length($w) + 25);
+ my $i = ' ' x (length($w) + 21);
my $fcheck = <<MOO
if(first && present(first)) /* first setopt check only */
err("$name", first, __LINE__);
elsif($type eq "CURLOPTTYPE_OFF_T") {
print $fh "${fpref} OFF_NO);\n$flongcheckzero";
print $fh "$ifpresent";
- my $lvl = " " x 29;
+ my $lvl = " " x 25;
print $fh "${pref}\n${lvl}(curl_off_t)22);\n$longcheck";
print $fh "${pref} OFF_HI);\n$longcheck";
print $fh "${pref} OFF_LO);\n$longcheck";
# Read the output of curl --version
my $curl_protocols="";
-open(CURL, "$ARGV[1]") || die "Cannot get curl $what list\n";
+open(CURL, $ARGV[1]) || die "Cannot get curl $what list\n";
while(<CURL>) {
$curl_protocols = $_ if(/$what:/i);
}
my $what=$ARGV[2];
# Read the output of curl --version
-open(CURL, "$ARGV[1]") || die "Cannot open curl --version list in $ARGV[1]\n";
+open(CURL, $ARGV[1]) || die "Cannot open curl --version list in $ARGV[1]\n";
$_ = <CURL>;
chomp;
/libcurl\/([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)/;
if($ENV{'CURL_TEST_EXE_EXT'}) {
return $ENV{'CURL_TEST_EXE_EXT'};
}
- if($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
- return $ENV{'CURL_TEST_EXE_EXT_'.$component};
+ if($ENV{'CURL_TEST_EXE_EXT_' . $component}) {
+ return $ENV{'CURL_TEST_EXE_EXT_' . $component};
}
if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
$^O eq 'dos' || $^O eq 'os2') {
#######################################################################
# Global variables set elsewhere but used only by this package
# These may only be set *before* runner_init is called
-our $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
-our $valgrind_logfile="--log-file"; # the option name for valgrind >=3
-our $valgrind_tool="--tool=memcheck";
+our $DBGCURL = $CURL; #"../src/.libs/curl"; # alternative for debugging
+our $valgrind_logfile = "--log-file"; # the option name for valgrind >=3
+our $valgrind_tool = "--tool=memcheck";
our $gdb = checktestcmd("gdb");
our $gdbthis = 0; # run test case with debugger (gdb or lldb)
our $gdbxwin; # use windowed gdb when using gdb
# redirected stdout/stderr to these files
sub stdoutfilename {
- my ($logdir, $testnum)=@_;
+ my ($logdir, $testnum) = @_;
return "$logdir/stdout$testnum";
}
sub stderrfilename {
- my ($logdir, $testnum)=@_;
+ my ($logdir, $testnum) = @_;
return "$logdir/stderr$testnum";
}
# runnerac_* functions
# Called by controller
sub runner_init {
- my ($logdir, $jobs)=@_;
+ my ($logdir, $jobs) = @_;
$multiprocess = !!$jobs;
# enable memory debugging if curl is compiled with it
$ENV{'CURL_MEMDEBUG'} = "$logdir/$MEMDUMP";
delete $ENV{'CURL_ENTROPY'} if($ENV{'CURL_ENTROPY'});
- $ENV{'CURL_FORCETIME'}=1; # for debug NTLM magic
- $ENV{'CURL_GLOBAL_INIT'}=1; # debug curl_global_init/cleanup use
- $ENV{'HOME'}=$pwd;
- $ENV{'CURL_HOME'}=$ENV{'HOME'};
- $ENV{'XDG_CONFIG_HOME'}=$ENV{'HOME'};
- $ENV{'COLUMNS'}=79; # screen width!
+ $ENV{'CURL_FORCETIME'} = 1; # for debug NTLM magic
+ $ENV{'CURL_GLOBAL_INIT'} = 1; # debug curl_global_init/cleanup use
+ $ENV{'HOME'} = $pwd;
+ $ENV{'CURL_HOME'} = $ENV{'HOME'};
+ $ENV{'XDG_CONFIG_HOME'} = $ENV{'HOME'};
+ $ENV{'COLUMNS'} = 79; # screen width!
# Incorporate the $logdir into the random seed and re-seed the PRNG.
# This gives each runner a unique yet consistent seed which provides
# Check for a command in the PATH of the machine running curl.
#
sub checktestcmd {
- my ($cmd)=@_;
- my @testpaths=($LIBDIR . ".libs", $LIBDIR);
+ my ($cmd) = @_;
+ my @testpaths = ($LIBDIR . ".libs", $LIBDIR);
return checkcmd($cmd, @testpaths);
}
logmsg " CMD: $testcmd\n" if($verbose);
# memanalyze -v is our friend, get the number of allocations made
- my $count=0;
+ my $count = 0;
my @out = memanalyze("$LOGDIR/$MEMDUMP", 1, 0, 0);
for(@out) {
if(/^Operations: (\d+)/) {
}
if($verbose) {
- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime(time());
my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
logmsg "Fail function no: $limit at $now\r";
# and does not core dump
if(($ret & 255) || ($ret >> 8) >= 128) {
logmsg " system() returned $ret\n";
- $fail=1;
+ $fail = 1;
}
else {
my @memdata = memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 0);
- my $leak=0;
+ my $leak = 0;
for(@memdata) {
if($_ ne "") {
# well it could be other memory problems as well, but
# we call it leak for short here
- $leak=1;
+ $leak = 1;
}
}
if($leak) {
# create (possibly-empty) files before starting the test
for my $partsuffix (('', '1', '2', '3', '4')) {
- my @inputfile=getpart("client", "file".$partsuffix);
+ my @inputfile = getpart("client", "file".$partsuffix);
my %fileattr = getpartattr("client", "file".$partsuffix);
- my $filename=$fileattr{'name'};
+ my $filename = $fileattr{'name'};
if(@inputfile || $filename) {
if(!$filename) {
logmsg " $testnum: IGNORED: Section client=>file has no name attribute\n";
}
else {
# there was no command given, use something silly
- $cmd="-";
+ $cmd = "-";
}
- my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
+ my $CURLOUT = "$LOGDIR/curl$testnum.out"; # curl output if not stdout
# if stdout section exists, we verify that the stdout contained this:
- my $out="";
+ my $out = "";
my %cmdhash = getpartattr("client", "command");
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
#We may slap on --output!
if(!partexists("verify", "stdout") ||
($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) {
- $out=" --output $CURLOUT ";
+ $out = " --output $CURLOUT ";
}
}
my @codepieces = getpart("client", "tool");
- my $tool="";
- my $tool_name=""; # without exe extension
+ my $tool = "";
+ my $tool_name = ""; # without exe extension
if(@codepieces) {
$tool_name = $codepieces[0];
chomp $tool_name;
my $oldmemdebug;
my $disablevalgrind;
- my $CMDLINE="";
+ my $CMDLINE = "";
my $cmdargs;
my $cmdtype = $cmdhash{'type'} || "default";
my $fail_due_event_based = $run_event_based;
if($cmdtype eq "perl") {
# run the command line prepended with "perl"
- $cmdargs =$cmd;
+ $cmdargs = $cmd;
$CMDLINE = "$perl ";
- $tool=$CMDLINE;
- $disablevalgrind=1;
+ $tool = $CMDLINE;
+ $disablevalgrind = 1;
}
elsif($cmdtype eq "shell") {
# run the command line prepended with "/bin/sh"
- $cmdargs =$cmd;
+ $cmdargs = $cmd;
$CMDLINE = "/bin/sh ";
- $tool=$CMDLINE;
- $disablevalgrind=1;
+ $tool = $CMDLINE;
+ $disablevalgrind = 1;
}
elsif(!$tool && !$keywords{"unittest"}) {
# run curl, add suitable command line options
- my $inc="";
+ my $inc = "";
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-include/)) {
$inc = " --include";
}
# Default the tool to a unit test with the same name as the test spec
if($keywords{"unittest"} && !$tool) {
- $tool_name="unit$testnum";
+ $tool_name = "unit$testnum";
$tool = $tool_name . exe_ext('TOOL');
}
if($tool =~ /^lib/) {
$tool = "libtests" . exe_ext('TOOL');
- $CMDLINE=$LIBDIR . $tool;
+ $CMDLINE = $LIBDIR . $tool;
}
elsif($tool =~ /^tool/) {
$tool = "tunits" . exe_ext('TOOL');
- $CMDLINE=$TUNITDIR . $tool;
+ $CMDLINE = $TUNITDIR . $tool;
}
elsif($tool =~ /^unit/) {
$tool = "units" . exe_ext('TOOL');
- $CMDLINE=$UNITDIR . $tool;
+ $CMDLINE = $UNITDIR . $tool;
}
if(! -f $CMDLINE) {
return (-1, 0, 0, "", "", 0);
}
- $CMDLINE=exerunner() . $CMDLINE;
+ $CMDLINE = exerunner() . $CMDLINE;
if($gdbthis) {
- $cmdargs =" $tool_name$cmdargs";
+ $cmdargs = " $tool_name$cmdargs";
}
else {
- $CMDLINE.=" $tool_name";
+ $CMDLINE .= " $tool_name";
}
- $DBGCURL=$CMDLINE;
+ $DBGCURL = $CMDLINE;
}
if($fail_due_event_based) {
# gdb is incompatible with valgrind, so disable it when debugging
# Perhaps a better approach would be to run it under valgrind anyway
# with --db-attach=yes or --vgdb=yes.
- $disablevalgrind=1;
+ $disablevalgrind = 1;
}
my @stdintest = getpart("client", "stdin");
if(@stdintest) {
- my $stdinfile="$LOGDIR/stdin-for-$testnum";
+ my $stdinfile = "$LOGDIR/stdin-for-$testnum";
my %hash = getpartattr("client", "stdin");
if($hash{'nonewline'}) {
}
if(!$tool) {
- $CMDLINE=exerunner() . shell_quote($CURL);
+ $CMDLINE = exerunner() . shell_quote($CURL);
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-q/)) {
$CMDLINE .= " -q";
}
# gdb
my $GDBW = ($gdbxwin) ? "-w" : "";
runclient("$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " $GDBW -x $LOGDIR/gdbcmd");
- $cmdres=0; # makes it always continue after a debugged run
+ $cmdres = 0; # makes it always continue after a debugged run
}
elsif($gdbthis == 2) {
# $gdb is "lldb"
print "runs lldb -- $CURL $cmdargs\n";
runclient("lldb -- $CURL $cmdargs");
- $cmdres=0; # makes it always continue after a debugged run
+ $cmdres = 0; # makes it always continue after a debugged run
}
else {
# Convert the raw result code into a more useful one
#######################################################################
# Clean up after test command
sub singletest_clean {
- my ($testnum, $dumped_core, $testtimings)=@_;
+ my ($testnum, $dumped_core, $testtimings) = @_;
if(!$dumped_core) {
if(-r "core") {
#######################################################################
# Verify that the postcheck succeeded
sub singletest_postcheck {
- my ($testnum)=@_;
+ my ($testnum) = @_;
# run the postcheck command
- my @postcheck= getpart("client", "postcheck");
+ my @postcheck = getpart("client", "postcheck");
if(@postcheck) {
die "test$testnum uses client/postcheck";
}
- @postcheck= getpart("verify", "postcheck");
+ @postcheck = getpart("verify", "postcheck");
if(@postcheck) {
my $cmd = join("", @postcheck);
chomp $cmd;
###################################################################
# Get ready to run a single test case
sub runner_test_preprocess {
- my ($testnum)=@_;
+ my ($testnum) = @_;
my %testtimings;
if(clearlogs()) {
# 1=unskippable test failure, as first integer, plus any log messages,
# plus more return values when error is 0
sub runner_test_run {
- my ($testnum)=@_;
+ my ($testnum) = @_;
if(clearlogs()) {
logmsg "Warning: log messages were lost\n";
# received.
# Called by controller
sub runnerac_shutdown {
- my ($runnerid)=$_[0];
+ my ($runnerid) = $_[0];
my $err = controlleripccall(\&runner_shutdown, @_);
# These have no more use
}
# system call was interrupted, probably by ^C; restart it so we stay in sync
}
- my $len=unpack("L", $datalen);
+ my $len = unpack("L", $datalen);
my $buf;
while(! defined ($err = sysread($controllerr{$runnerid}, $buf, $len)) || $err <= 0) {
if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {
my ($blocking) = @_;
my $r_in = "";
my %idbyfileno;
- my $maxfileno=0;
+ my $maxfileno = 0;
my @ready_runners = ();
foreach my $p (keys(%controllerr)) {
my $fd = fileno($controllerr{$p});
# caller will need to later call this function again.
# TODO: this is relatively slow with hundreds of fds
my $e_in = $r_in;
- if(select(my $r_out=$r_in, undef, my $e_out=$e_in, $blocking) >= 1) {
+ if(select(my $r_out = $r_in, undef, my $e_out = $e_in, $blocking) >= 1) {
for my $fd (0..$maxfileno) {
# Return an error condition first in case it is both
if(vec($e_out, $fd, 1)) {
}
# system call was interrupted, probably by ^C; restart it so we stay in sync
}
- my $len=unpack("L", $datalen);
+ my $len = unpack("L", $datalen);
my $buf;
while(! defined ($err = sysread($runnerr, $buf, $len)) || $err <= 0) {
if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {
!close($hostfile) ||
($SSHSRVMD5 !~ /^[a-f0-9]{32}$/i))
{
- my $msg = "Fatal: $srvrname pubkey md5 missing : \"$hstpubmd5f\" : $!";
+ my $msg = "Fatal: $srvrname pubkey MD5 missing : \"$hstpubmd5f\" : $!";
logmsg "$msg\n";
stopservers($verb);
die $msg;
(read($hostfile, $SSHSRVSHA256, 48) == 0) ||
!close($hostfile))
{
- my $msg = "Fatal: $srvrname pubkey sha256 missing : \"$hstpubsha256f\" : $!";
+ my $msg = "Fatal: $srvrname pubkey SHA256 missing : \"$hstpubsha256f\" : $!";
logmsg "$msg\n";
stopservers($verb);
die $msg;
my @rsahostkey = do { local $/ = ' '; <$rsakeyfile> };
close($rsakeyfile);
if(!$rsahostkey[1]) {
- logmsg "Failed parsing base64 encoded RSA host key\n";
+ logmsg "Failed parsing base64 encoded SSH host key\n";
exit 1;
}
open(my $pubmd5file, ">", pp($hstpubmd5f));
print $pubmd5file md5_hex(decode_base64($rsahostkey[1]));
close($pubmd5file);
if((! -e pp($hstpubmd5f)) || (! -s pp($hstpubmd5f))) {
- logmsg "Failed writing md5 hash of RSA host key\n";
+ logmsg "Failed writing MD5 hash of SSH host key\n";
exit 1;
}
open(my $pubsha256file, ">", pp($hstpubsha256f));
print $pubsha256file sha256_base64(decode_base64($rsahostkey[1]));
close($pubsha256file);
if((! -e pp($hstpubsha256f)) || (! -s pp($hstpubsha256f))) {
- logmsg "Failed writing sha256 hash of RSA host key\n";
+ logmsg "Failed writing SHA256 hash of SSH host key\n";
exit 1;
}
}
sub scanheader {
my ($f)=@_;
- open my $h, "<", $f;
+ open(my $h, "<", $f);
while(<$h>) {
if(/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) {
push @syms, $1;
my $s = $1;
# skip two "special" ones
if($s !~ /(^(CURLE_OBSOLETE|CURLOPT_TEMPLATE))|_$/) {
- push @manrefs, "$1:$m:$line";
+ push @manrefs, "$s:$m:$line";
}
}
$line++;
scanman_md_dir("$root/docs/libcurl");
scanman_md_dir("$root/docs/libcurl/opts");
-open my $s, "<", "$root/docs/libcurl/symbols-in-versions";
+open(my $s, "<", "$root/docs/libcurl/symbols-in-versions");
while(<$s>) {
if(/(^[^ \n]+) +(.*)/) {
my ($sym, $rest)=($1, $2);
sub scanheader {
my ($f)=@_;
scanenums($f);
- open H, "<$f";
+ open(H, '<', $f);
while(<H>) {
my ($line, $linenum) = ($_, $.);
if(/^ *# *define +([^ \n]*)/) {
*
***************************************************************************/
#include "unitcheck.h"
-
#include "tool_getparam.h"
static CURLcode test_tool1394(const char *arg)
#include "unitcheck.h"
#if defined(_WIN32) || defined(MSDOS)
-
#include "tool_cfgable.h"
#include "tool_doswin.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "tool_xattr.h"
static CURLcode test_tool1621(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "tool_progress.h"
static CURLcode test_tool1622(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "tool_getparam.h"
struct check1623 {
*
***************************************************************************/
#include "unitcheck.h"
-
#include "llist.h"
static void test_Curl_llist_dtor(void *key, void *value)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "url.h" /* for curlx_safefree */
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "connect.h"
#define BASE 1000000
/* macro to set the pretended current time */
-#define NOW(x,y) now.tv_sec = x; now.tv_usec = y
+#define NOW(x, y) now.tv_sec = x; now.tv_usec = y
/* macro to set the millisecond based timeouts to use */
-#define TIMEOUTS(x,y) easy->set.timeout = x; \
- easy->set.connecttimeout = y
+#define TIMEOUTS(x, y) easy->set.timeout = x; \
+ easy->set.connecttimeout = y
/*
* To test:
#include "unitcheck.h"
#ifndef CURL_DISABLE_NETRC
-
#include "netrc.h"
static void t1304_stop(char **password, char **login)
#include "unitcheck.h"
#ifndef CURL_DISABLE_FTP
-
#include "curl_fnmatch.h"
/*
*
***************************************************************************/
#include "unitcheck.h"
-
#include "splay.h"
static void splayprint(struct Curl_tree *t, int d, char output)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "vtls/hostcheck.h"
static CURLcode test_unit1397(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "progress.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "curl_ntlm_core.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "curl_md5.h"
static CURLcode test_unit1601(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "hash.h"
static void t1602_mydtor(void *p)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "hash.h"
static const size_t slots = 3;
*
***************************************************************************/
#include "unitcheck.h"
-
#include "llist.h"
static CURLcode t1605_setup(CURL **easy)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "connect.h"
#include "curl_addrinfo.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "connect.h"
#include "curl_addrinfo.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "curl_sha256.h"
static CURLcode t1610_setup(void)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "curl_md4.h"
static CURLcode test_unit1611(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "curl_hmac.h"
#include "curl_md5.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "noproxy.h"
static CURLcode test_unit1614(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "curl_sha512_256.h"
static CURLcode test_unit1615(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "url.h"
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
-
#include "urldata.h"
#include "url.h"
return CURLE_OK;
}
-#else
-/* for HTTP-disabled builds */
+#else /* CURL_DISABLE_HTTP */
static CURLcode test_unit1625(const char *arg)
{
(void)arg;
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
-
#include "urldata.h"
#include "url.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "url.h"
#include "strcase.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "vtls/x509asn1.h"
static CURLcode test_unit1651(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "curl_trc.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "altsvc.h"
#include "unitcheck.h"
#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
-
#include "vtls/x509asn1.h"
struct test_spec {
#include "unitcheck.h"
#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
-
#include "vtls/x509asn1.h"
struct test1657_spec {
/* DoH + HTTPSRR are required */
#if !defined(CURL_DISABLE_DOH) && defined(USE_HTTPSRR)
-
#include "doh.h"
#include "httpsrr.h"
#include "unitcheck.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HSTS)
-
#include "urldata.h"
#include "hsts.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "bufq.h"
#include "curl_trc.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "dynhds.h"
#include "curl_trc.h"
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
-
#include "urldata.h"
#include "http1.h"
#include "curl_trc.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "vtls/cipher_suite.h"
static CURLcode test_unit3205(const char *arg)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "uint-table.h"
#include "curl_trc.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
#include "uint-spbset.h"
#include "curl_trc.h"
*
***************************************************************************/
#include "unitcheck.h"
-
#include "urldata.h"
static void checksize(const char *name, size_t size, size_t allowed)
*
***************************************************************************/
#include "unitcheck.h"
-
#include "ratelimit.h"
static CURLcode test_unit3216(const char *arg)