mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
parent
cbb5544c45
commit
ccba492024
36 changed files with 114 additions and 118 deletions
|
|
@ -45,4 +45,4 @@ Checks:
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
misc-header-include-cycle.IgnoredFilesList: 'curl/curl.h'
|
misc-header-include-cycle.IgnoredFilesList: 'curl/curl.h'
|
||||||
|
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: '.*' # Default in v22.1.0+
|
||||||
|
|
|
||||||
|
|
@ -2356,6 +2356,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||||
# TARGETS_EXPORT_NAME
|
# TARGETS_EXPORT_NAME
|
||||||
# CURL_SUPPORTED_FEATURES_LIST
|
# CURL_SUPPORTED_FEATURES_LIST
|
||||||
# CURL_SUPPORTED_PROTOCOLS_LIST
|
# CURL_SUPPORTED_PROTOCOLS_LIST
|
||||||
|
# CURL_USE_PKGCONFIG
|
||||||
# HAVE_BROTLI
|
# HAVE_BROTLI
|
||||||
# HAVE_GSSAPI
|
# HAVE_GSSAPI
|
||||||
# HAVE_LIBIDN2
|
# HAVE_LIBIDN2
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,9 @@ if [ -n "${CMAKE_GENERATOR:-}" ]; then
|
||||||
|
|
||||||
# Install custom cmake version
|
# Install custom cmake version
|
||||||
if [ -n "${CMAKE_VERSION:-}" ]; then
|
if [ -n "${CMAKE_VERSION:-}" ]; then
|
||||||
cmake_ver=$(printf '%02d%02d' \
|
cmake_ver="$(printf '%02d%02d' \
|
||||||
"$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \
|
"$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \
|
||||||
"$(echo "${CMAKE_VERSION}" | cut -f2 -d.)")
|
"$(echo "${CMAKE_VERSION}" | cut -f2 -d.)")"
|
||||||
if [ "${cmake_ver}" -ge '0320' ]; then
|
if [ "${cmake_ver}" -ge '0320' ]; then
|
||||||
fn="cmake-${CMAKE_VERSION}-windows-x86_64"
|
fn="cmake-${CMAKE_VERSION}-windows-x86_64"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,7 @@ Select from these:
|
||||||
--with-amissl
|
--with-amissl
|
||||||
--with-gnutls
|
--with-gnutls
|
||||||
--with-mbedtls
|
--with-mbedtls
|
||||||
--with-openssl (also works for BoringSSL and LibreSSL)
|
--with-openssl (also works for AWS-LC, BoringSSL and LibreSSL)
|
||||||
--with-rustls
|
--with-rustls
|
||||||
--with-schannel
|
--with-schannel
|
||||||
--with-wolfssl
|
--with-wolfssl
|
||||||
|
|
@ -2047,8 +2047,8 @@ if test "$USE_WIN32_CRYPTO" = "1" || test "$SCHANNEL_ENABLED" = "1"; then
|
||||||
LIBS="-ladvapi32 -lcrypt32 $LIBS"
|
LIBS="-ladvapi32 -lcrypt32 $LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
|
|
||||||
if test "$curl_cv_native_windows" = "yes"; then
|
if test "$curl_cv_native_windows" = "yes"; then
|
||||||
|
dnl for BCryptGenRandom()
|
||||||
LIBS="-lbcrypt $LIBS"
|
LIBS="-lbcrypt $LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@ Example: to add a `struct foobar` to a linked list. Add a node struct within
|
||||||
it:
|
it:
|
||||||
|
|
||||||
struct foobar {
|
struct foobar {
|
||||||
char *random;
|
char *random;
|
||||||
struct Curl_llist_node storage; /* can be anywhere in the struct */
|
struct Curl_llist_node storage; /* can be anywhere in the struct */
|
||||||
char *data;
|
char *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Curl_llist barlist; /* the list for foobar entries */
|
struct Curl_llist barlist; /* the list for foobar entries */
|
||||||
|
|
@ -77,18 +77,18 @@ To iterate over a list: first get the head entry and then iterate over the
|
||||||
nodes as long there is a next. Each node has an *element* associated with it,
|
nodes as long there is a next. Each node has an *element* associated with it,
|
||||||
the custom pointer you stored there. Usually a struct pointer or similar.
|
the custom pointer you stored there. Usually a struct pointer or similar.
|
||||||
|
|
||||||
struct Curl_llist_node *iter;
|
struct Curl_llist_node *iter;
|
||||||
|
|
||||||
/* get the first entry of the 'barlist' */
|
/* get the first entry of the 'barlist' */
|
||||||
iter = Curl_llist_head(&barlist);
|
iter = Curl_llist_head(&barlist);
|
||||||
|
|
||||||
while(iter) {
|
while(iter) {
|
||||||
/* extract the element pointer from the node */
|
/* extract the element pointer from the node */
|
||||||
struct foobar *elem = Curl_node_elem(iter);
|
struct foobar *elem = Curl_node_elem(iter);
|
||||||
|
|
||||||
/* advance to the next node in the list */
|
/* advance to the next node in the list */
|
||||||
iter = Curl_node_next(iter);
|
iter = Curl_node_next(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function overview
|
# Function overview
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ curl_easy_getinfo - extract information from a curl handle
|
||||||
~~~c
|
~~~c
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );
|
CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ the time it is called.
|
||||||
|
|
||||||
~~~c
|
~~~c
|
||||||
struct curl_header {
|
struct curl_header {
|
||||||
char *name;
|
char *name;
|
||||||
char *value;
|
char *value;
|
||||||
size_t amount;
|
size_t amount;
|
||||||
size_t index;
|
size_t index;
|
||||||
unsigned int origin;
|
unsigned int origin;
|
||||||
void *anchor;
|
void *anchor;
|
||||||
};
|
};
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ curl_easy_pause - pause and unpause a connection
|
||||||
~~~c
|
~~~c
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
CURLcode curl_easy_pause(CURL *handle, int bitmask );
|
CURLcode curl_easy_pause(CURL *handle, int bitmask);
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,10 @@ static int push_cb(CURL *parent,
|
||||||
int i = 0;
|
int i = 0;
|
||||||
char *field;
|
char *field;
|
||||||
do {
|
do {
|
||||||
field = curl_pushheader_bynum(headers, i);
|
field = curl_pushheader_bynum(headers, i);
|
||||||
if(field)
|
if(field)
|
||||||
fprintf(stderr, "Push header: %s\n", field);
|
fprintf(stderr, "Push header: %s\n", field);
|
||||||
i++;
|
i++;
|
||||||
} while(field);
|
} while(field);
|
||||||
return CURL_PUSH_OK; /* permission granted */
|
return CURL_PUSH_OK; /* permission granted */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ NULL
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct callback_data {
|
struct callback_data {
|
||||||
FILE *output;
|
FILE *output;
|
||||||
};
|
};
|
||||||
|
|
||||||
static long file_is_coming(struct curl_fileinfo *finfo,
|
static long file_is_coming(struct curl_fileinfo *finfo,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ NULL
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct callback_data {
|
struct callback_data {
|
||||||
FILE *output;
|
FILE *output;
|
||||||
};
|
};
|
||||||
|
|
||||||
static long file_is_coming(struct curl_fileinfo *finfo,
|
static long file_is_coming(struct curl_fileinfo *finfo,
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ NULL
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct callback_data {
|
struct callback_data {
|
||||||
FILE *output;
|
FILE *output;
|
||||||
};
|
};
|
||||||
|
|
||||||
static long file_is_downloaded(void *ptr)
|
static long file_is_downloaded(void *ptr)
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ signal that it already is connected.
|
||||||
|
|
||||||
The equivalent of this:
|
The equivalent of this:
|
||||||
~~~c
|
~~~c
|
||||||
return socket(addr->family, addr->socktype, addr->protocol);
|
return socket(addr->family, addr->socktype, addr->protocol);
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
# %PROTOCOLS%
|
# %PROTOCOLS%
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ GitHub Actions runs the following tests:
|
||||||
- Tests with a variety of different compilation options, OSes, CPUs.
|
- Tests with a variety of different compilation options, OSes, CPUs.
|
||||||
- Fuzz tests ([see the curl-fuzzer repo for more
|
- Fuzz tests ([see the curl-fuzzer repo for more
|
||||||
info](https://github.com/curl/curl-fuzzer)).
|
info](https://github.com/curl/curl-fuzzer)).
|
||||||
- Static analysis and sanitizers: clang-tidy, scan-build, address sanitizer,
|
- Static analysis and sanitizers: clang-tidy, address sanitizer,
|
||||||
memory sanitizer, thread sanitizer, CodeQL, valgrind, torture tests.
|
memory sanitizer, thread sanitizer, CodeQL, valgrind, torture tests.
|
||||||
|
|
||||||
These are each configured in different files in `.github/workflows`.
|
These are each configured in different files in `.github/workflows`.
|
||||||
|
|
|
||||||
|
|
@ -1281,7 +1281,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf,
|
||||||
set_local_ip(cf, data);
|
set_local_ip(cf, data);
|
||||||
CURL_TRC_CF(data, cf, "local address %s port %d...",
|
CURL_TRC_CF(data, cf, "local address %s port %d...",
|
||||||
ctx->ip.local_ip, ctx->ip.local_port);
|
ctx->ip.local_ip, ctx->ip.local_port);
|
||||||
if(-1 == rc) {
|
if(rc == -1) {
|
||||||
result = socket_connect_result(data, ctx->ip.remote_ip, error);
|
result = socket_connect_result(data, ctx->ip.remote_ip, error);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
@ -1801,7 +1801,7 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
|
||||||
NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions) */
|
NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions) */
|
||||||
rc = connect(ctx->sock, &ctx->addr.curl_sa_addr,
|
rc = connect(ctx->sock, &ctx->addr.curl_sa_addr,
|
||||||
(curl_socklen_t)ctx->addr.addrlen);
|
(curl_socklen_t)ctx->addr.addrlen);
|
||||||
if(-1 == rc) {
|
if(rc == -1) {
|
||||||
return socket_connect_result(data, ctx->ip.remote_ip, SOCKERRNO);
|
return socket_connect_result(data, ctx->ip.remote_ip, SOCKERRNO);
|
||||||
}
|
}
|
||||||
ctx->sock_connected = TRUE;
|
ctx->sock_connected = TRUE;
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ static CURLcode storecookie(struct Cookie *co, struct Curl_str *cp,
|
||||||
/* No path was given in the header line, set the default */
|
/* No path was given in the header line, set the default */
|
||||||
const char *endslash = strrchr(path, '/');
|
const char *endslash = strrchr(path, '/');
|
||||||
if(endslash)
|
if(endslash)
|
||||||
plen = (endslash - path + 1); /* include end slash */
|
plen = endslash - path + 1; /* include end slash */
|
||||||
else
|
else
|
||||||
plen = strlen(path);
|
plen = strlen(path);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
|
||||||
matched = !pRtlVerifyVersionInfo(&osver, dwTypeMask, cm);
|
matched = !pRtlVerifyVersionInfo(&osver, dwTypeMask, cm);
|
||||||
else
|
else
|
||||||
matched = !!VerifyVersionInfoW((OSVERSIONINFOEXW *)&osver,
|
matched = !!VerifyVersionInfoW((OSVERSIONINFOEXW *)&osver,
|
||||||
dwTypeMask, cm);
|
dwTypeMask, cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
16
lib/doh.h
16
lib/doh.h
|
|
@ -29,14 +29,14 @@
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DOH_OK,
|
DOH_OK,
|
||||||
DOH_DNS_BAD_LABEL, /* 1 */
|
DOH_DNS_BAD_LABEL, /* 1 */
|
||||||
DOH_DNS_OUT_OF_RANGE, /* 2 */
|
DOH_DNS_OUT_OF_RANGE, /* 2 */
|
||||||
DOH_DNS_LABEL_LOOP, /* 3 */
|
DOH_DNS_LABEL_LOOP, /* 3 */
|
||||||
DOH_TOO_SMALL_BUFFER, /* 4 */
|
DOH_TOO_SMALL_BUFFER, /* 4 */
|
||||||
DOH_OUT_OF_MEM, /* 5 */
|
DOH_OUT_OF_MEM, /* 5 */
|
||||||
DOH_DNS_RDATA_LEN, /* 6 */
|
DOH_DNS_RDATA_LEN, /* 6 */
|
||||||
DOH_DNS_MALFORMAT, /* 7 */
|
DOH_DNS_MALFORMAT, /* 7 */
|
||||||
DOH_DNS_BAD_RCODE, /* 8 - no such name */
|
DOH_DNS_BAD_RCODE, /* 8 - no such name */
|
||||||
DOH_DNS_UNEXPECTED_TYPE, /* 9 */
|
DOH_DNS_UNEXPECTED_TYPE, /* 9 */
|
||||||
DOH_DNS_UNEXPECTED_CLASS, /* 10 */
|
DOH_DNS_UNEXPECTED_CLASS, /* 10 */
|
||||||
DOH_NO_CONTENT, /* 11 */
|
DOH_NO_CONTENT, /* 11 */
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ typedef struct md4_ctx MD4_CTX;
|
||||||
* The MD4 transformation for all three rounds.
|
* The MD4 transformation for all three rounds.
|
||||||
*/
|
*/
|
||||||
#define MD4_STEP(f, a, b, c, d, x, s) \
|
#define MD4_STEP(f, a, b, c, d, x, s) \
|
||||||
(a) += f((b), (c), (d)) + (x); \
|
(a) += f(b, c, d) + (x); \
|
||||||
(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s))));
|
(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s))));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ typedef struct md5_ctx my_md5_ctx;
|
||||||
* The MD5 transformation for all four rounds.
|
* The MD5 transformation for all four rounds.
|
||||||
*/
|
*/
|
||||||
#define MD5_STEP(f, a, b, c, d, x, t, s) \
|
#define MD5_STEP(f, a, b, c, d, x, t, s) \
|
||||||
(a) += f((b), (c), (d)) + (x) + (t); \
|
(a) += f(b, c, d) + (x) + (t); \
|
||||||
(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
|
(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
|
||||||
(a) += (b);
|
(a) += (b);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -481,12 +481,12 @@ static int parsedate(const char *date, time_t *output)
|
||||||
part++;
|
part++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(-1 == secnum)
|
if(secnum == -1)
|
||||||
secnum = minnum = hournum = 0; /* no time, make it zero */
|
secnum = minnum = hournum = 0; /* no time, make it zero */
|
||||||
|
|
||||||
if((-1 == mdaynum) ||
|
if((mdaynum == -1) ||
|
||||||
(-1 == monnum) ||
|
(monnum == -1) ||
|
||||||
(-1 == yearnum))
|
(yearnum == -1))
|
||||||
/* lacks vital info, fail */
|
/* lacks vital info, fail */
|
||||||
return PARSEDATE_FAIL;
|
return PARSEDATE_FAIL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ static const unsigned long K[64] = {
|
||||||
|
|
||||||
#define Sha256_Ch(x, y, z) (z ^ (x & (y ^ z)))
|
#define Sha256_Ch(x, y, z) (z ^ (x & (y ^ z)))
|
||||||
#define Sha256_Maj(x, y, z) (((x | y) & z) | (x & y))
|
#define Sha256_Maj(x, y, z) (((x | y) & z) | (x & y))
|
||||||
#define Sha256_S(x, n) RORc((x), (n))
|
#define Sha256_S(x, n) RORc(x, n)
|
||||||
#define Sha256_R(x, n) (((x) & 0xFFFFFFFFUL) >> (n))
|
#define Sha256_R(x, n) (((x) & 0xFFFFFFFFUL) >> (n))
|
||||||
|
|
||||||
#define Sigma0(x) (Sha256_S(x, 2) ^ Sha256_S(x, 13) ^ Sha256_S(x, 22))
|
#define Sigma0(x) (Sha256_S(x, 2) ^ Sha256_S(x, 13) ^ Sha256_S(x, 22))
|
||||||
|
|
@ -416,7 +416,7 @@ static void my_sha256_final(unsigned char *out, void *ctx)
|
||||||
*/
|
*/
|
||||||
if(md->curlen > 56) {
|
if(md->curlen > 56) {
|
||||||
while(md->curlen < 64) {
|
while(md->curlen < 64) {
|
||||||
md->buf[md->curlen++] = (unsigned char)0;
|
md->buf[md->curlen++] = 0;
|
||||||
}
|
}
|
||||||
sha256_compress(md, md->buf);
|
sha256_compress(md, md->buf);
|
||||||
md->curlen = 0;
|
md->curlen = 0;
|
||||||
|
|
@ -424,7 +424,7 @@ static void my_sha256_final(unsigned char *out, void *ctx)
|
||||||
|
|
||||||
/* Pad up to 56 bytes of zeroes */
|
/* Pad up to 56 bytes of zeroes */
|
||||||
while(md->curlen < 56) {
|
while(md->curlen < 56) {
|
||||||
md->buf[md->curlen++] = (unsigned char)0;
|
md->buf[md->curlen++] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store length */
|
/* Store length */
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
#define CURLPROTO_WSS 0L
|
#define CURLPROTO_WSS 0L
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CURLPROTO_MQTTS (1LL << 32)
|
#define CURLPROTO_MQTTS (1LL << 32)
|
||||||
|
|
||||||
#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
|
#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ typedef curl_off_t curl_prot_t;
|
||||||
/* This mask is for all the old protocols that are provided and defined in the
|
/* This mask is for all the old protocols that are provided and defined in the
|
||||||
public header and shall exclude protocols added since which are not exposed
|
public header and shall exclude protocols added since which are not exposed
|
||||||
in the API */
|
in the API */
|
||||||
#define CURLPROTO_MASK (0x3ffffff)
|
#define CURLPROTO_MASK 0x3ffffff
|
||||||
|
|
||||||
#define CURL_DEFAULT_USER "anonymous"
|
#define CURL_DEFAULT_USER "anonymous"
|
||||||
#define CURL_DEFAULT_PASSWORD "ftp@example.com"
|
#define CURL_DEFAULT_PASSWORD "ftp@example.com"
|
||||||
|
|
|
||||||
|
|
@ -2063,8 +2063,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf,
|
||||||
pktcnt = 0;
|
pktcnt = 0;
|
||||||
}
|
}
|
||||||
else if(nread < gsolen) {
|
else if(nread < gsolen) {
|
||||||
/* Reached MAX_PKT_BURST *or*
|
/* Reached capacity of our buffer *or*
|
||||||
* the capacity of our buffer *or*
|
|
||||||
* last add was shorter than the previous ones, flush */
|
* last add was shorter than the previous ones, flush */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ if(!$filedate) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# get the hash from the download file
|
# get the hash from the download file
|
||||||
my $newhash= sha256($txt);
|
my $newhash = sha256($txt);
|
||||||
|
|
||||||
if(!$opt_f && $oldhash eq $newhash) {
|
if(!$opt_f && $oldhash eq $newhash) {
|
||||||
report "Downloaded file identical to previous run\'s source file. Exiting";
|
report "Downloaded file identical to previous run\'s source file. Exiting";
|
||||||
|
|
@ -426,7 +426,7 @@ print CRT <<EOT;
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
report "Processing '$txt' ...";
|
report "Processing '$txt' ...";
|
||||||
my $caname;
|
my $caname;
|
||||||
my $certnum = 0;
|
my $certnum = 0;
|
||||||
my $skipnum = 0;
|
my $skipnum = 0;
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
_tidy_cflags :=
|
_tidy_cflags :=
|
||||||
TIDYFLAGS =
|
TIDYFLAGS :=
|
||||||
if CURL_WERROR
|
if CURL_WERROR
|
||||||
TIDYFLAGS += '--warnings-as-errors=*'
|
TIDYFLAGS += '--warnings-as-errors=*'
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,7 @@ static CURLcode test_lib560(const char *URL)
|
||||||
|
|
||||||
start_test_timing();
|
start_test_timing();
|
||||||
|
|
||||||
/*
|
/* curl_global_init called indirectly from curl_easy_init */
|
||||||
** curl_global_init called indirectly from curl_easy_init.
|
|
||||||
*/
|
|
||||||
|
|
||||||
easy_init(curl);
|
easy_init(curl);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ my @not_built_in_num = (
|
||||||
#
|
#
|
||||||
|
|
||||||
my $allowedstringerrors = <<MOO
|
my $allowedstringerrors = <<MOO
|
||||||
switch(code) {
|
switch(result) {
|
||||||
case CURLE_BAD_FUNCTION_ARGUMENT:
|
case CURLE_BAD_FUNCTION_ARGUMENT:
|
||||||
MOO
|
MOO
|
||||||
;
|
;
|
||||||
|
|
@ -137,7 +137,7 @@ MOO
|
||||||
#
|
#
|
||||||
|
|
||||||
my $allowednumerrors = <<MOO
|
my $allowednumerrors = <<MOO
|
||||||
switch(code) {
|
switch(result) {
|
||||||
case CURLE_UNSUPPORTED_PROTOCOL:
|
case CURLE_UNSUPPORTED_PROTOCOL:
|
||||||
MOO
|
MOO
|
||||||
;
|
;
|
||||||
|
|
@ -240,50 +240,50 @@ static size_t readcb(char *buffer,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errlongzero(const char *name, CURLcode code, int lineno)
|
static void errlongzero(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
curl_mprintf("%s set to 0 returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s set to 0 returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, code, curl_easy_strerror(code), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errlong(const char *name, CURLcode code, int lineno)
|
static void errlong(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
$allowednumerrors
|
$allowednumerrors
|
||||||
curl_mprintf("%s set to non-zero returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s set to non-zero returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, code, curl_easy_strerror(code), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errneg(const char *name, CURLcode code, int lineno)
|
static void errneg(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
curl_mprintf("%s set to -1 returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s set to -1 returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, code, curl_easy_strerror(code), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errstring(const char *name, CURLcode code, int lineno)
|
static void errstring(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
/* allow this set of options to return CURLE_BAD_FUNCTION_ARGUMENT
|
/* allow this set of options to return CURLE_BAD_FUNCTION_ARGUMENT
|
||||||
when given a strange string input */
|
when given a strange string input */
|
||||||
$allowedstringerrors
|
$allowedstringerrors
|
||||||
curl_mprintf("%s set to a string returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s set to a string returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, code, curl_easy_strerror(code), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void err(const char *name, CURLcode val, int lineno)
|
static void err(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
curl_mprintf("%s returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, val, curl_easy_strerror(val), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errnull(const char *name, CURLcode val, int lineno)
|
static void errnull(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
curl_mprintf("%s set to NULL returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("%s set to NULL returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, val, curl_easy_strerror(val), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t1521_geterr(const char *name, CURLcode val, int lineno)
|
static void t1521_geterr(const char *name, CURLcode result, int lineno)
|
||||||
{
|
{
|
||||||
curl_mprintf("CURLINFO_%s returned %d, \\"%s\\" on line %d\\n",
|
curl_mprintf("CURLINFO_%s returned %d, \\"%s\\" on line %d\\n",
|
||||||
name, val, curl_easy_strerror(val), lineno);
|
name, result, curl_easy_strerror(result), lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
static curl_progress_callback progresscb;
|
static curl_progress_callback progresscb;
|
||||||
|
|
|
||||||
|
|
@ -200,11 +200,11 @@ static int decodedata(char **buf, /* dest buffer */
|
||||||
|
|
||||||
if(!src_len) {
|
if(!src_len) {
|
||||||
/*
|
/*
|
||||||
** currently there is no way to tell apart an OOM condition in
|
* currently there is no way to tell apart an OOM condition in
|
||||||
** curlx_base64_decode() from zero length decoded data. For now,
|
* curlx_base64_decode() from zero length decoded data. For now,
|
||||||
** let's just assume it is an OOM condition, currently we have
|
* let's just assume it is an OOM condition, currently we have
|
||||||
** no input for this function that decodes to zero length data.
|
* no input for this function that decodes to zero length data.
|
||||||
*/
|
*/
|
||||||
free(buf64);
|
free(buf64);
|
||||||
|
|
||||||
return GPE_OUT_OF_MEMORY;
|
return GPE_OUT_OF_MEMORY;
|
||||||
|
|
@ -300,8 +300,8 @@ int getpart(char **outbuf, size_t *outlen,
|
||||||
|
|
||||||
if('/' == *ptr) {
|
if('/' == *ptr) {
|
||||||
/*
|
/*
|
||||||
** closing section tag
|
* closing section tag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ptr++;
|
ptr++;
|
||||||
end = ptr;
|
end = ptr;
|
||||||
|
|
@ -356,8 +356,8 @@ int getpart(char **outbuf, size_t *outlen,
|
||||||
}
|
}
|
||||||
else if(!in_wanted_part) {
|
else if(!in_wanted_part) {
|
||||||
/*
|
/*
|
||||||
** opening section tag
|
* opening section tag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* get potential tag */
|
/* get potential tag */
|
||||||
end = ptr;
|
end = ptr;
|
||||||
|
|
|
||||||
|
|
@ -619,7 +619,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req)
|
||||||
pipereq_length = req->offset - req->checkindex;
|
pipereq_length = req->offset - req->checkindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Init the httprequest structure properly for the upcoming request ***/
|
/* Init the httprequest structure properly for the upcoming request */
|
||||||
|
|
||||||
req->checkindex = 0;
|
req->checkindex = 0;
|
||||||
req->offset = 0;
|
req->offset = 0;
|
||||||
|
|
@ -640,7 +640,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req)
|
||||||
req->rtp_buffer = NULL;
|
req->rtp_buffer = NULL;
|
||||||
req->rtp_buffersize = 0;
|
req->rtp_buffersize = 0;
|
||||||
|
|
||||||
/*** end of httprequest init ***/
|
/* end of httprequest init */
|
||||||
|
|
||||||
while(!done_processing && (req->offset < sizeof(req->reqbuf) - 1)) {
|
while(!done_processing && (req->offset < sizeof(req->reqbuf) - 1)) {
|
||||||
if(pipereq_length && pipereq) {
|
if(pipereq_length && pipereq) {
|
||||||
|
|
@ -1212,9 +1212,9 @@ static int test_rtspd(int argc, const char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** As soon as this server writes its pid file the test harness will
|
* As soon as this server writes its pid file the test harness will
|
||||||
** attempt to connect to this server and initiate its verification.
|
* attempt to connect to this server and initiate its verification.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wrotepidfile = write_pidfile(pidname);
|
wrotepidfile = write_pidfile(pidname);
|
||||||
if(!wrotepidfile)
|
if(!wrotepidfile)
|
||||||
|
|
@ -1239,10 +1239,10 @@ static int test_rtspd(int argc, const char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** As soon as this server accepts a connection from the test harness it
|
* As soon as this server accepts a connection from the test harness it
|
||||||
** must set the server logs advisor read lock to indicate that server
|
* must set the server logs advisor read lock to indicate that server
|
||||||
** logs should not be read until this lock is removed by this server.
|
* logs should not be read until this lock is removed by this server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
set_advisor_read_lock(loglockfile);
|
set_advisor_read_lock(loglockfile);
|
||||||
serverlogslocked = 1;
|
serverlogslocked = 1;
|
||||||
|
|
|
||||||
|
|
@ -1855,10 +1855,10 @@ static curl_socket_t accept_connection(curl_socket_t sock)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** As soon as this server accepts a connection from the test harness it
|
* As soon as this server accepts a connection from the test harness it
|
||||||
** must set the server logs advisor read lock to indicate that server
|
* must set the server logs advisor read lock to indicate that server
|
||||||
** logs should not be read until this lock is removed by this server.
|
* logs should not be read until this lock is removed by this server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!serverlogslocked)
|
if(!serverlogslocked)
|
||||||
set_advisor_read_lock(loglockfile);
|
set_advisor_read_lock(loglockfile);
|
||||||
|
|
@ -2275,9 +2275,9 @@ static int test_sws(int argc, const char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** As soon as this server writes its pid file the test harness will
|
* As soon as this server writes its pid file the test harness will
|
||||||
** attempt to connect to this server and initiate its verification.
|
* attempt to connect to this server and initiate its verification.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wrotepidfile = write_pidfile(pidname);
|
wrotepidfile = write_pidfile(pidname);
|
||||||
if(!wrotepidfile)
|
if(!wrotepidfile)
|
||||||
|
|
|
||||||
|
|
@ -254,10 +254,10 @@ void clear_advisor_read_lock(const char *filename)
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Log all removal failures. Even those due to file not existing.
|
* Log all removal failures. Even those due to file not existing.
|
||||||
** This allows to detect if unexpectedly the file has already been
|
* This allows to detect if unexpectedly the file has already been
|
||||||
** removed by a process different than the one that should do this.
|
* removed by a process different than the one that should do this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
do {
|
do {
|
||||||
res = unlink(filename);
|
res = unlink(filename);
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ for my $e (sort @syms) {
|
||||||
#
|
#
|
||||||
# CURL_TEMP_ - are defined and *undefined* again within the file
|
# CURL_TEMP_ - are defined and *undefined* again within the file
|
||||||
#
|
#
|
||||||
# *_LAST and *_LASTENTRY are just prefix for the placeholders used for the
|
# *_LAST and *_LASTENTRY are just suffix for the placeholders used for the
|
||||||
# last entry in many enum series.
|
# last entry in many enum series.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,7 @@ static CURLcode test_unit1398(const char *arg)
|
||||||
int width = 3;
|
int width = 3;
|
||||||
char output[130];
|
char output[130];
|
||||||
|
|
||||||
#if 0
|
/* #define curl_msnprintf snprintf */
|
||||||
#define curl_msnprintf snprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* without a trailing zero */
|
/* without a trailing zero */
|
||||||
rc = curl_msnprintf(output, 4, "%.*s", width, buf);
|
rc = curl_msnprintf(output, 4, "%.*s", width, buf);
|
||||||
|
|
|
||||||
|
|
@ -94,12 +94,12 @@ static CURLcode test_unit2604(const char *arg)
|
||||||
}
|
}
|
||||||
if(!result) {
|
if(!result) {
|
||||||
if(cp && strcmp(cp, list[i].next)) {
|
if(cp && strcmp(cp, list[i].next)) {
|
||||||
curl_mprintf("... cp points to '%s', not '%s' as expected \n",
|
curl_mprintf("... cp points to '%s', not '%s' as expected\n",
|
||||||
cp, list[i].next);
|
cp, list[i].next);
|
||||||
unitfail++;
|
unitfail++;
|
||||||
}
|
}
|
||||||
if(path && strcmp(path, list[i].expect)) {
|
if(path && strcmp(path, list[i].expect)) {
|
||||||
curl_mprintf("... gave '%s', not '%s' as expected \n",
|
curl_mprintf("... gave '%s', not '%s' as expected\n",
|
||||||
path, list[i].expect);
|
path, list[i].expect);
|
||||||
unitfail++;
|
unitfail++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,12 @@ static CURLcode test_unit2605(const char *arg)
|
||||||
}
|
}
|
||||||
if(!result) {
|
if(!result) {
|
||||||
if(start != list[i].start) {
|
if(start != list[i].start) {
|
||||||
curl_mprintf("... start (%" FMT_OFF_T ") was not %" FMT_OFF_T " \n",
|
curl_mprintf("... start (%" FMT_OFF_T ") was not %" FMT_OFF_T "\n",
|
||||||
start, list[i].start);
|
start, list[i].start);
|
||||||
unitfail++;
|
unitfail++;
|
||||||
}
|
}
|
||||||
if(size != list[i].size) {
|
if(size != list[i].size) {
|
||||||
curl_mprintf("... size (%" FMT_OFF_T ") was not %" FMT_OFF_T " \n",
|
curl_mprintf("... size (%" FMT_OFF_T ") was not %" FMT_OFF_T "\n",
|
||||||
size, list[i].size);
|
size, list[i].size);
|
||||||
unitfail++;
|
unitfail++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue