mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:43:32 +03:00
parent
7a1e99eefa
commit
0476e4fc65
149 changed files with 1381 additions and 1376 deletions
|
|
@ -174,22 +174,22 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
handles[i].fail_write = 1;
|
||||
handles[i].curl = curl_easy_init();
|
||||
if(!handles[i].curl ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_WRITEFUNCTION, cb)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_WRITEDATA, &handles[i])
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_FOLLOWLOCATION, 1L)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_VERBOSE, 1L) != CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_SSL_VERIFYPEER, 0L)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_RESOLVE, resolve)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n");
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_WRITEFUNCTION, cb)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_WRITEDATA, &handles[i])
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_FOLLOWLOCATION, 1L)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_VERBOSE, 1L) != CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_SSL_VERIFYPEER, 0L)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_RESOLVE, resolve)
|
||||
!= CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK ||
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n");
|
||||
res = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,8 +178,8 @@ static int my_progress_d_cb(void *userdata,
|
|||
#endif
|
||||
#ifdef USE_MBEDTLS
|
||||
case CURLSSLBACKEND_MBEDTLS: {
|
||||
const char *version = mbedtls_ssl_get_version(
|
||||
(mbedtls_ssl_context*)tls->internals);
|
||||
const char *version =
|
||||
mbedtls_ssl_get_version((mbedtls_ssl_context *)tls->internals);
|
||||
assert(version);
|
||||
assert(strcmp(version, "unknown"));
|
||||
curl_mfprintf(stderr, "[t-%zu] info mbedTLS using %s\n",
|
||||
|
|
@ -190,7 +190,7 @@ static int my_progress_d_cb(void *userdata,
|
|||
#ifdef USE_RUSTLS
|
||||
case CURLSSLBACKEND_RUSTLS: {
|
||||
int v = rustls_connection_get_protocol_version(
|
||||
(struct rustls_connection*)tls->internals);
|
||||
(struct rustls_connection *)tls->internals);
|
||||
assert(v);
|
||||
curl_mfprintf(stderr, "[t-%zu] info rustls TLS version 0x%x\n",
|
||||
t->idx, v);
|
||||
|
|
@ -514,8 +514,8 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
if(!t->started) {
|
||||
t->curl = curl_easy_init();
|
||||
if(!t->curl ||
|
||||
setup_hx_download(t->curl, url, t, http_version, host, share,
|
||||
use_earlydata, fresh_connect)) {
|
||||
setup_hx_download(t->curl, url, t, http_version, host, share,
|
||||
use_earlydata, fresh_connect)) {
|
||||
curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i);
|
||||
res = (CURLcode)1;
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ int unitfail; /* for unittests */
|
|||
int coptind;
|
||||
const char *coptarg;
|
||||
|
||||
int cgetopt(int argc, const char *const argv[], const char *optstring)
|
||||
int cgetopt(int argc, const char * const argv[], const char *optstring)
|
||||
{
|
||||
static int optpos = 1;
|
||||
int coptopt;
|
||||
|
|
@ -141,7 +141,7 @@ static void memory_tracking_init(void)
|
|||
}
|
||||
}
|
||||
#else
|
||||
# define memory_tracking_init() Curl_nop_stmt
|
||||
#define memory_tracking_init() Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
/* returns a hexdump in a static memory area */
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ extern int unitfail; /* for unittests */
|
|||
#define CURL_GNUC_DIAG
|
||||
#endif
|
||||
|
||||
#define test_setopt(A,B,C) \
|
||||
#define test_setopt(A, B, C) \
|
||||
if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \
|
||||
goto test_cleanup
|
||||
|
||||
#define test_multi_setopt(A,B,C) \
|
||||
#define test_multi_setopt(A, B, C) \
|
||||
if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) \
|
||||
goto test_cleanup
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ extern struct curltime tv_test_start; /* for test timing */
|
|||
|
||||
extern int coptind;
|
||||
extern const char *coptarg;
|
||||
int cgetopt(int argc, const char *const argv[], const char *optstring);
|
||||
int cgetopt(int argc, const char * const argv[], const char *optstring);
|
||||
|
||||
extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
|
||||
struct timeval *tv);
|
||||
|
|
@ -100,18 +100,18 @@ void ws_close(CURL *curl);
|
|||
** For portability reasons TEST_ERR_* values should be less than 127.
|
||||
*/
|
||||
|
||||
#define TEST_ERR_MAJOR_BAD CURLE_OBSOLETE20
|
||||
#define TEST_ERR_RUNS_FOREVER CURLE_OBSOLETE24
|
||||
#define TEST_ERR_EASY_INIT CURLE_OBSOLETE29
|
||||
#define TEST_ERR_MULTI CURLE_OBSOLETE32
|
||||
#define TEST_ERR_NUM_HANDLES CURLE_OBSOLETE34
|
||||
#define TEST_ERR_SELECT CURLE_OBSOLETE40
|
||||
#define TEST_ERR_SUCCESS CURLE_OBSOLETE41
|
||||
#define TEST_ERR_FAILURE CURLE_OBSOLETE44
|
||||
#define TEST_ERR_USAGE CURLE_OBSOLETE46
|
||||
#define TEST_ERR_FOPEN CURLE_OBSOLETE50
|
||||
#define TEST_ERR_FSTAT CURLE_OBSOLETE51
|
||||
#define TEST_ERR_BAD_TIMEOUT CURLE_OBSOLETE57
|
||||
#define TEST_ERR_MAJOR_BAD CURLE_OBSOLETE20
|
||||
#define TEST_ERR_RUNS_FOREVER CURLE_OBSOLETE24
|
||||
#define TEST_ERR_EASY_INIT CURLE_OBSOLETE29
|
||||
#define TEST_ERR_MULTI CURLE_OBSOLETE32
|
||||
#define TEST_ERR_NUM_HANDLES CURLE_OBSOLETE34
|
||||
#define TEST_ERR_SELECT CURLE_OBSOLETE40
|
||||
#define TEST_ERR_SUCCESS CURLE_OBSOLETE41
|
||||
#define TEST_ERR_FAILURE CURLE_OBSOLETE44
|
||||
#define TEST_ERR_USAGE CURLE_OBSOLETE46
|
||||
#define TEST_ERR_FOPEN CURLE_OBSOLETE50
|
||||
#define TEST_ERR_FSTAT CURLE_OBSOLETE51
|
||||
#define TEST_ERR_BAD_TIMEOUT CURLE_OBSOLETE57
|
||||
|
||||
/*
|
||||
** Macros for test source code readability/maintainability.
|
||||
|
|
@ -144,7 +144,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_easy_init(A,Y,Z) do { \
|
||||
#define exe_easy_init(A, Y, Z) do { \
|
||||
if(((A) = curl_easy_init()) == NULL) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \
|
||||
res = TEST_ERR_EASY_INIT; \
|
||||
|
|
@ -154,10 +154,10 @@ void ws_close(CURL *curl);
|
|||
#define res_easy_init(A) \
|
||||
exe_easy_init((A), (__FILE__), (__LINE__))
|
||||
|
||||
#define chk_easy_init(A,Y,Z) do { \
|
||||
exe_easy_init((A), (Y), (Z)); \
|
||||
if(res) \
|
||||
goto test_cleanup; \
|
||||
#define chk_easy_init(A, Y, Z) do { \
|
||||
exe_easy_init((A), (Y), (Z)); \
|
||||
if(res) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
#define easy_init(A) \
|
||||
|
|
@ -165,7 +165,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_init(A,Y,Z) do { \
|
||||
#define exe_multi_init(A, Y, Z) do { \
|
||||
if(((A) = curl_multi_init()) == NULL) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
|
|
@ -175,10 +175,10 @@ void ws_close(CURL *curl);
|
|||
#define res_multi_init(A) \
|
||||
exe_multi_init((A), (__FILE__), (__LINE__))
|
||||
|
||||
#define chk_multi_init(A,Y,Z) do { \
|
||||
exe_multi_init((A), (Y), (Z)); \
|
||||
if(res) \
|
||||
goto test_cleanup; \
|
||||
#define chk_multi_init(A, Y, Z) do { \
|
||||
exe_multi_init((A), (Y), (Z)); \
|
||||
if(res) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
#define multi_init(A) \
|
||||
|
|
@ -186,7 +186,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_easy_setopt(A,B,C,Y,Z) do { \
|
||||
#define exe_easy_setopt(A, B, C, Y, Z) do { \
|
||||
CURLcode ec; \
|
||||
if((ec = curl_easy_setopt((A), (B), (C))) != CURLE_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_setopt() failed, " \
|
||||
|
|
@ -220,21 +220,21 @@ void ws_close(CURL *curl);
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
#define res_multi_setopt(A,B,C) \
|
||||
#define res_multi_setopt(A, B, C) \
|
||||
exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__))
|
||||
|
||||
#define chk_multi_setopt(A,B,C,Y,Z) do { \
|
||||
#define chk_multi_setopt(A, B, C, Y, Z) do { \
|
||||
exe_multi_setopt((A), (B), (C), (Y), (Z)); \
|
||||
if(res) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
#define multi_setopt(A,B,C) \
|
||||
#define multi_setopt(A, B, C) \
|
||||
chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__))
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_add_handle(A,B,Y,Z) do { \
|
||||
#define exe_multi_add_handle(A, B, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_add_handle((A), (B))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \
|
||||
|
|
@ -258,7 +258,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_remove_handle(A,B,Y,Z) do { \
|
||||
#define exe_multi_remove_handle(A, B, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_remove_handle((A), (B))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \
|
||||
|
|
@ -283,7 +283,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_perform(A,B,Y,Z) do { \
|
||||
#define exe_multi_perform(A, B, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_perform((A), (B))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_perform() failed, " \
|
||||
|
|
@ -308,7 +308,7 @@ void ws_close(CURL *curl);
|
|||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
#define multi_perform(A,B) \
|
||||
#define multi_perform(A, B) \
|
||||
chk_multi_perform((A), (B), (__FILE__), (__LINE__))
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
|
@ -343,7 +343,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_timeout(A,B,Y,Z) do { \
|
||||
#define exe_multi_timeout(A, B, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_timeout((A), (B))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_timeout() failed, " \
|
||||
|
|
@ -373,7 +373,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_poll(A,B,C,D,E,Y,Z) do { \
|
||||
#define exe_multi_poll(A, B, C, D, E, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_poll((A), (B), (C), (D), (E))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll() failed, " \
|
||||
|
|
@ -403,7 +403,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_multi_wakeup(A,Y,Z) do { \
|
||||
#define exe_multi_wakeup(A, Y, Z) do { \
|
||||
CURLMcode ec; \
|
||||
if((ec = curl_multi_wakeup((A))) != CURLM_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \
|
||||
|
|
@ -460,7 +460,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
#define TEST_HANG_TIMEOUT 60 * 1000 /* global default */
|
||||
|
||||
#define exe_test_timedout(T,Y,Z) do { \
|
||||
#define exe_test_timedout(T, Y, Z) do { \
|
||||
timediff_t timediff = curlx_timediff_ms(curlx_now(), tv_test_start); \
|
||||
if(timediff > (T)) { \
|
||||
curl_mfprintf(stderr, "%s:%d ABORTING TEST, since it seems " \
|
||||
|
|
@ -490,7 +490,7 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define exe_global_init(A,Y,Z) do { \
|
||||
#define exe_global_init(A, Y, Z) do { \
|
||||
CURLcode ec; \
|
||||
if((ec = curl_global_init((A))) != CURLE_OK) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_global_init() failed, " \
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
*/
|
||||
|
||||
#define F_RESUME (1 << 0) /* resume/range. */
|
||||
#define F_HTTP416 (1 << 1) /* Server returns http code 416. */
|
||||
#define F_FAIL (1 << 2) /* Fail on error. */
|
||||
#define F_CONTENTRANGE (1 << 3) /* Server sends content-range hdr. */
|
||||
#define F_IGNOREBODY (1 << 4) /* Body should be ignored. */
|
||||
#define F_RESUME (1 << 0) /* resume/range. */
|
||||
#define F_HTTP416 (1 << 1) /* Server returns http code 416. */
|
||||
#define F_FAIL (1 << 2) /* Fail on error. */
|
||||
#define F_CONTENTRANGE (1 << 3) /* Server sends content-range hdr. */
|
||||
#define F_IGNOREBODY (1 << 4) /* Body should be ignored. */
|
||||
|
||||
struct testparams {
|
||||
unsigned int flags; /* ORed flags as above. */
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1506(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl[NUM_HANDLES] = {0};
|
||||
CURL *curl[NUM_HANDLES] = { 0 };
|
||||
int running;
|
||||
CURLM *multi = NULL;
|
||||
size_t i;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
static CURLcode test_lib1512(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl[2] = {NULL, NULL};
|
||||
CURL *curl[2] = { NULL, NULL };
|
||||
const char *port = libtest_arg3;
|
||||
const char *address = libtest_arg2;
|
||||
char dnsentry[256];
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ static CURLcode test_lib1514(const char *URL)
|
|||
|
||||
static char testdata[] = "dummy";
|
||||
|
||||
struct t1514_WriteThis pooh = { testdata, sizeof(testdata)-1 };
|
||||
struct t1514_WriteThis pooh = { testdata, sizeof(testdata) - 1 };
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static CURLcode test_lib1520(const char *URL)
|
|||
CURLcode res;
|
||||
CURL *curl;
|
||||
struct curl_slist *rcpt_list = NULL;
|
||||
struct upload_status upload_ctx = {0};
|
||||
struct upload_status upload_ctx = { 0 };
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_global_init() failed\n");
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
static CURLcode test_lib1537(const char *URL)
|
||||
{
|
||||
const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7};
|
||||
const unsigned char a[] = { 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7 };
|
||||
CURLcode res = CURLE_OK;
|
||||
char *ptr = NULL;
|
||||
int asize;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ struct t1541_transfer_status {
|
|||
int bd_count;
|
||||
};
|
||||
|
||||
#define KN(a) a, #a
|
||||
#define KN(a) a, #a
|
||||
|
||||
static void t1541_geterr(const char *name, CURLcode val, int lineno)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ static CURLcode test_lib1550(const char *URL)
|
|||
CURLM *multi;
|
||||
CURLcode res = CURLE_OK;
|
||||
static const char * const bl_servers[] =
|
||||
{"Microsoft-IIS/6.0", "nginx/0.8.54", NULL};
|
||||
{ "Microsoft-IIS/6.0", "nginx/0.8.54", NULL };
|
||||
static const char * const bl_sites[] =
|
||||
{"curl.se:443", "example.com:80", NULL};
|
||||
{ "curl.se:443", "example.com:80", NULL };
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
multi = curl_multi_init();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static CURLcode test_lib1556(const char *URL)
|
|||
CURLcode code;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
struct headerinfo info = {0};
|
||||
struct headerinfo info = { 0 };
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
|
|||
|
|
@ -1859,18 +1859,18 @@ static int get_nothing(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct clearurlcase clear_url_list[] ={
|
||||
{CURLUPART_SCHEME, "http", NULL, CURLUE_NO_SCHEME},
|
||||
{CURLUPART_USER, "user", NULL, CURLUE_NO_USER},
|
||||
{CURLUPART_PASSWORD, "password", NULL, CURLUE_NO_PASSWORD},
|
||||
{CURLUPART_OPTIONS, "options", NULL, CURLUE_NO_OPTIONS},
|
||||
{CURLUPART_HOST, "host", NULL, CURLUE_NO_HOST},
|
||||
{CURLUPART_ZONEID, "eth0", NULL, CURLUE_NO_ZONEID},
|
||||
{CURLUPART_PORT, "1234", NULL, CURLUE_NO_PORT},
|
||||
{CURLUPART_PATH, "/hello", "/", CURLUE_OK},
|
||||
{CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY},
|
||||
{CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT},
|
||||
{CURLUPART_URL, NULL, NULL, CURLUE_OK},
|
||||
static const struct clearurlcase clear_url_list[] = {
|
||||
{ CURLUPART_SCHEME, "http", NULL, CURLUE_NO_SCHEME },
|
||||
{ CURLUPART_USER, "user", NULL, CURLUE_NO_USER },
|
||||
{ CURLUPART_PASSWORD, "password", NULL, CURLUE_NO_PASSWORD },
|
||||
{ CURLUPART_OPTIONS, "options", NULL, CURLUE_NO_OPTIONS },
|
||||
{ CURLUPART_HOST, "host", NULL, CURLUE_NO_HOST },
|
||||
{ CURLUPART_ZONEID, "eth0", NULL, CURLUE_NO_ZONEID },
|
||||
{ CURLUPART_PORT, "1234", NULL, CURLUE_NO_PORT },
|
||||
{ CURLUPART_PATH, "/hello", "/", CURLUE_OK },
|
||||
{ CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY },
|
||||
{ CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT },
|
||||
{ CURLUPART_URL, NULL, NULL, CURLUE_OK },
|
||||
};
|
||||
|
||||
static int clear_url(void)
|
||||
|
|
@ -1935,7 +1935,7 @@ static int huge(void)
|
|||
memset(&bigpart[1], 'a', sizeof(bigpart) - 2);
|
||||
bigpart[sizeof(bigpart) - 1] = 0;
|
||||
|
||||
for(i = 0; i < 7; i++) {
|
||||
for(i = 0; i < 7; i++) {
|
||||
char *partp;
|
||||
curl_msnprintf(total, sizeof(total),
|
||||
"%s://%s:%s@%s/%s?%s#%s",
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#ifdef HAVE_PTHREAD_H
|
||||
#include <pthread.h>
|
||||
|
||||
#define CONN_NUM 3
|
||||
#define CONN_NUM 3
|
||||
#define TIME_BETWEEN_START_SECS 2
|
||||
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ static CURLcode test_lib1597(const char *URL)
|
|||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
curl_version_info_data *curlinfo;
|
||||
const char *const *proto;
|
||||
const char * const *proto;
|
||||
int n;
|
||||
int i;
|
||||
static CURLcode ok = CURLE_OK;
|
||||
|
|
@ -47,22 +47,22 @@ static CURLcode test_lib1597(const char *URL)
|
|||
static char protolist[1024];
|
||||
|
||||
static const struct pair prots[] = {
|
||||
{"goobar", &unsup},
|
||||
{"http ", &unsup},
|
||||
{" http", &unsup},
|
||||
{"http", &httpcode},
|
||||
{"http,", &httpcode},
|
||||
{"https,", &httpscode},
|
||||
{"https,http", &httpscode},
|
||||
{"http,http", &httpcode},
|
||||
{"HTTP,HTTP", &httpcode},
|
||||
{",HTTP,HTTP", &httpcode},
|
||||
{"http,http,ft", &unsup},
|
||||
{"", &bad},
|
||||
{",,", &bad},
|
||||
{protolist, &ok},
|
||||
{"all", &ok},
|
||||
{NULL, NULL},
|
||||
{ "goobar", &unsup },
|
||||
{ "http ", &unsup },
|
||||
{ " http", &unsup },
|
||||
{ "http", &httpcode },
|
||||
{ "http,", &httpcode },
|
||||
{ "https,", &httpscode },
|
||||
{ "https,http", &httpscode },
|
||||
{ "http,http", &httpcode },
|
||||
{ "HTTP,HTTP", &httpcode },
|
||||
{ ",HTTP,HTTP", &httpcode },
|
||||
{ "http,http,ft", &unsup },
|
||||
{ "", &bad },
|
||||
{ ",,", &bad },
|
||||
{ protolist, &ok },
|
||||
{ "all", &ok },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
(void)URL;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,9 +49,7 @@ static CURLcode test_lib1911(const char *URL)
|
|||
|
||||
curl_mprintf("string length: %zu\n", strlen(testbuf));
|
||||
|
||||
for(o = curl_easy_option_next(NULL);
|
||||
o;
|
||||
o = curl_easy_option_next(o)) {
|
||||
for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) {
|
||||
if(o->type == CURLOT_STRING) {
|
||||
CURLcode res;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ static CURLcode test_lib1912(const char *URL)
|
|||
int error = 0;
|
||||
#ifdef CURLINC_TYPECHECK_GCC_H
|
||||
const struct curl_easyoption *o;
|
||||
for(o = curl_easy_option_next(NULL);
|
||||
o;
|
||||
o = curl_easy_option_next(o)) {
|
||||
for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) {
|
||||
/* Test for mismatch OR missing typecheck macros */
|
||||
if(curlcheck_long_option(o->id) !=
|
||||
(o->type == CURLOT_LONG || o->type == CURLOT_VALUES)) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ static CURLcode test_lib1915(const char *URL)
|
|||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl;
|
||||
struct state st = {0};
|
||||
struct state st = { 0 };
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ static CURLcode test_lib1918(const char *URL)
|
|||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
for(o = curl_easy_option_next(NULL);
|
||||
o;
|
||||
o = curl_easy_option_next(o)) {
|
||||
for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) {
|
||||
const struct curl_easyoption *ename =
|
||||
curl_easy_option_by_name(o->name);
|
||||
const struct curl_easyoption *eid =
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1938(const char *URL)
|
|||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
unsigned char data[] = {0x70, 0x6f, 0x73, 0x74, 0, 0x44, 0x61, 0x74, 0x61};
|
||||
unsigned char data[] = { 0x70, 0x6f, 0x73, 0x74, 0, 0x44, 0x61, 0x74, 0x61 };
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_global_init() failed\n");
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data)
|
|||
return size * nmemb;
|
||||
}
|
||||
|
||||
static CURLcode test_lib2032(const char *URL) /* libntlmconnect */
|
||||
static CURLcode test_lib2032(const char *URL) /* libntlmconnect */
|
||||
{
|
||||
enum HandleState {
|
||||
ReadyForNewHandle,
|
||||
|
|
@ -175,10 +175,9 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */
|
|||
"handle (trying again)\n");
|
||||
continue;
|
||||
}
|
||||
state = num_handles < MAX_EASY_HANDLES ? ReadyForNewHandle
|
||||
: NoMoreHandles;
|
||||
curl_mfprintf(stderr, "%s:%d new state %d\n",
|
||||
__FILE__, __LINE__, state);
|
||||
state =
|
||||
num_handles < MAX_EASY_HANDLES ? ReadyForNewHandle : NoMoreHandles;
|
||||
curl_mfprintf(stderr, "%s:%d new state %d\n", __FILE__, __LINE__, state);
|
||||
}
|
||||
|
||||
multi_timeout(multi, &timeout);
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ static size_t t2301_write_cb(char *b, size_t size, size_t nitems, void *p)
|
|||
unsigned char *buffer = (unsigned char *)b;
|
||||
size_t i;
|
||||
size_t sent;
|
||||
unsigned char pong[] = {
|
||||
0x8a, 0x0
|
||||
};
|
||||
unsigned char pong[] = { 0x8a, 0x0 };
|
||||
size_t incoming = nitems;
|
||||
curl_mfprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %zu bytes: ",
|
||||
nitems);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib2402(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl[NUM_HANDLES] = {0};
|
||||
CURL *curl[NUM_HANDLES] = { 0 };
|
||||
int running;
|
||||
CURLM *multi = NULL;
|
||||
size_t i;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib2404(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl[NUM_HANDLES] = {0};
|
||||
CURL *curl[NUM_HANDLES] = { 0 };
|
||||
int running;
|
||||
CURLM *multi = NULL;
|
||||
size_t i;
|
||||
|
|
|
|||
|
|
@ -41,22 +41,23 @@
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define test_check(expected_fds) \
|
||||
if(res != CURLE_OK) { \
|
||||
curl_mfprintf(stderr, "test failed with code: %d\n", res); \
|
||||
goto test_cleanup; \
|
||||
} \
|
||||
else if(fd_count != expected_fds) { \
|
||||
#define test_check(expected_fds) \
|
||||
if(res != CURLE_OK) { \
|
||||
curl_mfprintf(stderr, "test failed with code: %d\n", res); \
|
||||
goto test_cleanup; \
|
||||
} \
|
||||
else if(fd_count != expected_fds) { \
|
||||
curl_mfprintf(stderr, "Max number of waitfds: %u not as expected: %u\n", \
|
||||
fd_count, expected_fds); \
|
||||
res = TEST_ERR_FAILURE; \
|
||||
goto test_cleanup; \
|
||||
fd_count, expected_fds); \
|
||||
res = TEST_ERR_FAILURE; \
|
||||
goto test_cleanup; \
|
||||
}
|
||||
|
||||
#define test_run_check(option, expected_fds) do { \
|
||||
res = test_run(URL, option, &fd_count); \
|
||||
test_check(expected_fds); \
|
||||
} while(0)
|
||||
#define test_run_check(option, expected_fds) \
|
||||
do { \
|
||||
res = test_run(URL, option, &fd_count); \
|
||||
test_check(expected_fds); \
|
||||
} while(0)
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
static CURLcode test_lib2502(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl[NUM_HANDLES] = {0};
|
||||
CURL *curl[NUM_HANDLES] = { 0 };
|
||||
int running;
|
||||
CURLM *multi = NULL;
|
||||
size_t i;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "curl_threads.h"
|
||||
|
||||
#define THREAD_SIZE 16
|
||||
#define THREAD_SIZE 16
|
||||
#define PER_THREAD_SIZE 8
|
||||
|
||||
struct Ctx {
|
||||
|
|
|
|||
|
|
@ -76,8 +76,10 @@ static void custom_free(void *ptr)
|
|||
|
||||
static CURLcode test_lib509(const char *URL)
|
||||
{
|
||||
static const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7};
|
||||
static const unsigned char a[] = {
|
||||
0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7
|
||||
};
|
||||
CURLcode res;
|
||||
CURL *curl;
|
||||
int asize;
|
||||
|
|
|
|||
|
|
@ -31,130 +31,130 @@ static CURLcode test_lib517(const char *URL)
|
|||
};
|
||||
|
||||
static const struct dcheck dates[] = {
|
||||
{"Sun, 06 Nov 1994 08:49:37 GMT", 784111777 },
|
||||
{"Sunday, 06-Nov-94 08:49:37 GMT", 784111777 },
|
||||
{"Sun Nov 6 08:49:37 1994", 784111777 },
|
||||
{"Sun Nov 6 8:49:37 1994", 784111777 },
|
||||
{"Sun Nov 6 8:9:37 1994", 784109377 },
|
||||
{"Sun Nov 6 008:09:37 1994", -1 },
|
||||
{"Nov Sun 6 8:9:7 1994", 784109347 },
|
||||
{"06 Nov 1994 08:49:37 GMT", 784111777 },
|
||||
{"06-Nov-94 08:49:37 GMT", 784111777 },
|
||||
{"Nov 6 08:49:37 1994", 784111777 },
|
||||
{"06 Nov 1994 08:49:37", 784111777 },
|
||||
{"06-Nov-94 08:49:37", 784111777 },
|
||||
{"1994 Nov 6 08:49:37", 784111777 },
|
||||
{"GMT 08:49:37 06-Nov-94 Sunday", 784111777 },
|
||||
{"94 6 Nov 08:49:37", 784111777 },
|
||||
{"1994 Nov 6", 784080000 },
|
||||
{"06-Nov-94", 784080000 },
|
||||
{"Sun Nov 6 94", 784080000 },
|
||||
{"1994.Nov.6", 784080000 },
|
||||
{"Sun/Nov/6/94/GMT", 784080000 },
|
||||
{"Sun, 06 Nov 1994 08:49:37 CET", 784108177 },
|
||||
{"06 Nov 1994 08:49:37 EST", 784129777 },
|
||||
{"Sun, 06 Nov 1994 08:49:37 UT", 784111777 },
|
||||
{"Sun, 12 Sep 2004 15:05:58 -0700", 1095026758 },
|
||||
{"Sat, 11 Sep 2004 21:32:11 +0200", 1094931131 },
|
||||
{"20040912 15:05:58 -0700", 1095026758 },
|
||||
{"20040911 +0200", 1094853600 },
|
||||
{"Thu, 01-Jan-1970 00:59:59 GMT", 3599 },
|
||||
{"Thu, 01-Jan-1970 01:00:00 GMT", 3600 },
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{"Thu, 19-Apr-2007 16:00:00 GMT", 1176998400 },
|
||||
{"Wed, 25 Apr 2007 21:02:13 GMT", 1177534933 },
|
||||
{"Thu, 19/Apr\\2007 16:00:00 GMT", 1176998400 },
|
||||
{"Fri, 1 Jan 2010 01:01:50 GMT", 1262307710 },
|
||||
{"Wednesday, 1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{", 1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{"1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{"1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{"Wed,18-Apr-07 22:50:12 GMT", 1176936612 },
|
||||
{"WillyWonka , 18-Apr-07 22:50:12 GMT", -1 },
|
||||
{"WillyWonka , 18-Apr-07 22:50:12", -1 },
|
||||
{"WillyWonka , 18-apr-07 22:50:12", -1 },
|
||||
{"Mon, 18-Apr-1977 22:50:13 GMT", 230251813 },
|
||||
{"Mon, 18-Apr-77 22:50:13 GMT", 230251813 },
|
||||
{"Sat, 15-Apr-17\"21:01:22\"GMT", 1492290082 },
|
||||
{"Partyday, 18- April-07 22:50:12", -1 },
|
||||
{"Partyday, 18 - Apri-07 22:50:12", -1 },
|
||||
{"Wednes, 1-Januar-2003 00:00:00 GMT", -1 },/* spellchecker:disable-line */
|
||||
{"Sat, 15-Apr-17 21:01:22", 1492290082 },
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT-2", 1492290082 },
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT BLAH", 1492290082 },
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT-0400", 1492290082 },
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)", 1492290082 },
|
||||
{"Sat, 15-Apr-17 21:01:22 DST", -1 },
|
||||
{"Sat, 15-Apr-17 21:01:22 -0400", 1492304482 },
|
||||
{"Sat, 15-Apr-17 21:01:22 (hello there)", -1 },
|
||||
{"Sat, 15-Apr-17 21:01:22 11:22:33", -1 },
|
||||
{"Sat, 15-Apr-17 ::00 21:01:22", -1 },
|
||||
{"Sat, 15-Apr-17 boink:z 21:01:22", -1 },
|
||||
{"Sat, 15-Apr-17 91:22:33 21:01:22", -1 },
|
||||
{"Thu Apr 18 22:50:12 2007 GMT", 1176936612 },
|
||||
{"22:50:12 Thu Apr 18 2007 GMT", 1176936612 },
|
||||
{"Thu 22:50:12 Apr 18 2007 GMT", 1176936612 },
|
||||
{"Thu Apr 22:50:12 18 2007 GMT", 1176936612 },
|
||||
{"Thu Apr 18 22:50:12 2007 GMT", 1176936612 },
|
||||
{"Thu Apr 18 2007 22:50:12 GMT", 1176936612 },
|
||||
{"Thu Apr 18 2007 GMT 22:50:12", 1176936612 },
|
||||
{ "Sun, 06 Nov 1994 08:49:37 GMT", 784111777 },
|
||||
{ "Sunday, 06-Nov-94 08:49:37 GMT", 784111777 },
|
||||
{ "Sun Nov 6 08:49:37 1994", 784111777 },
|
||||
{ "Sun Nov 6 8:49:37 1994", 784111777 },
|
||||
{ "Sun Nov 6 8:9:37 1994", 784109377 },
|
||||
{ "Sun Nov 6 008:09:37 1994", -1 },
|
||||
{ "Nov Sun 6 8:9:7 1994", 784109347 },
|
||||
{ "06 Nov 1994 08:49:37 GMT", 784111777 },
|
||||
{ "06-Nov-94 08:49:37 GMT", 784111777 },
|
||||
{ "Nov 6 08:49:37 1994", 784111777 },
|
||||
{ "06 Nov 1994 08:49:37", 784111777 },
|
||||
{ "06-Nov-94 08:49:37", 784111777 },
|
||||
{ "1994 Nov 6 08:49:37", 784111777 },
|
||||
{ "GMT 08:49:37 06-Nov-94 Sunday", 784111777 },
|
||||
{ "94 6 Nov 08:49:37", 784111777 },
|
||||
{ "1994 Nov 6", 784080000 },
|
||||
{ "06-Nov-94", 784080000 },
|
||||
{ "Sun Nov 6 94", 784080000 },
|
||||
{ "1994.Nov.6", 784080000 },
|
||||
{ "Sun/Nov/6/94/GMT", 784080000 },
|
||||
{ "Sun, 06 Nov 1994 08:49:37 CET", 784108177 },
|
||||
{ "06 Nov 1994 08:49:37 EST", 784129777 },
|
||||
{ "Sun, 06 Nov 1994 08:49:37 UT", 784111777 },
|
||||
{ "Sun, 12 Sep 2004 15:05:58 -0700", 1095026758 },
|
||||
{ "Sat, 11 Sep 2004 21:32:11 +0200", 1094931131 },
|
||||
{ "20040912 15:05:58 -0700", 1095026758 },
|
||||
{ "20040911 +0200", 1094853600 },
|
||||
{ "Thu, 01-Jan-1970 00:59:59 GMT", 3599 },
|
||||
{ "Thu, 01-Jan-1970 01:00:00 GMT", 3600 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{ "Thu, 19-Apr-2007 16:00:00 GMT", 1176998400 },
|
||||
{ "Wed, 25 Apr 2007 21:02:13 GMT", 1177534933 },
|
||||
{ "Thu, 19/Apr\\2007 16:00:00 GMT", 1176998400 },
|
||||
{ "Fri, 1 Jan 2010 01:01:50 GMT", 1262307710 },
|
||||
{ "Wednesday, 1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{ ", 1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{ "1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{ "1-Jan-2003 00:00:00 GMT", 1041379200 },
|
||||
{ "Wed,18-Apr-07 22:50:12 GMT", 1176936612 },
|
||||
{ "WillyWonka , 18-Apr-07 22:50:12 GMT", -1 },
|
||||
{ "WillyWonka , 18-Apr-07 22:50:12", -1 },
|
||||
{ "WillyWonka , 18-apr-07 22:50:12", -1 },
|
||||
{ "Mon, 18-Apr-1977 22:50:13 GMT", 230251813 },
|
||||
{ "Mon, 18-Apr-77 22:50:13 GMT", 230251813 },
|
||||
{ "Sat, 15-Apr-17\"21:01:22\"GMT", 1492290082 },
|
||||
{ "Partyday, 18- April-07 22:50:12", -1 },
|
||||
{ "Partyday, 18 - Apri-07 22:50:12", -1 },
|
||||
{ "Wednes, 1-Januar-2003 00:00:00 GMT", -1 },
|
||||
{ "Sat, 15-Apr-17 21:01:22", 1492290082 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT-2", 1492290082 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT BLAH", 1492290082 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT-0400", 1492290082 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)", 1492290082 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 DST", -1 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 -0400", 1492304482 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 (hello there)", -1 },
|
||||
{ "Sat, 15-Apr-17 21:01:22 11:22:33", -1 },
|
||||
{ "Sat, 15-Apr-17 ::00 21:01:22", -1 },
|
||||
{ "Sat, 15-Apr-17 boink:z 21:01:22", -1 },
|
||||
{ "Sat, 15-Apr-17 91:22:33 21:01:22", -1 },
|
||||
{ "Thu Apr 18 22:50:12 2007 GMT", 1176936612 },
|
||||
{ "22:50:12 Thu Apr 18 2007 GMT", 1176936612 },
|
||||
{ "Thu 22:50:12 Apr 18 2007 GMT", 1176936612 },
|
||||
{ "Thu Apr 22:50:12 18 2007 GMT", 1176936612 },
|
||||
{ "Thu Apr 18 22:50:12 2007 GMT", 1176936612 },
|
||||
{ "Thu Apr 18 2007 22:50:12 GMT", 1176936612 },
|
||||
{ "Thu Apr 18 2007 GMT 22:50:12", 1176936612 },
|
||||
|
||||
{"\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 },
|
||||
{"-\"22:50:12 Thu Apr 18 2007 GMT\"", 1176936612 },
|
||||
{"*\"Thu 22:50:12 Apr 18 2007 GMT\"", 1176936612 },
|
||||
{";\"Thu Apr 22:50:12 18 2007 GMT\"", 1176936612 },
|
||||
{".\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 },
|
||||
{"\"Thu Apr 18 2007 22:50:12 GMT\"", 1176936612 },
|
||||
{"\"Thu Apr 18 2007 GMT 22:50:12\"", 1176936612 },
|
||||
{ "\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 },
|
||||
{ "-\"22:50:12 Thu Apr 18 2007 GMT\"", 1176936612 },
|
||||
{ "*\"Thu 22:50:12 Apr 18 2007 GMT\"", 1176936612 },
|
||||
{ ";\"Thu Apr 22:50:12 18 2007 GMT\"", 1176936612 },
|
||||
{ ".\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 },
|
||||
{ "\"Thu Apr 18 2007 22:50:12 GMT\"", 1176936612 },
|
||||
{ "\"Thu Apr 18 2007 GMT 22:50:12\"", 1176936612 },
|
||||
|
||||
{"Sat, 15-Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{"15-Sat, Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{"15-Sat, Apr 21:01:22 GMT 17", 1492290082 },
|
||||
{"15-Sat, Apr 21:01:22 GMT 2017", 1492290082 },
|
||||
{"15 Apr 21:01:22 2017", 1492290082 },
|
||||
{"15 17 Apr 21:01:22", 1492290082 },
|
||||
{"Apr 15 17 21:01:22", 1492290082 },
|
||||
{"Apr 15 21:01:22 17", 1492290082 },
|
||||
{"2017 April 15 21:01:22", -1 },
|
||||
{"15 April 2017 21:01:22", -1 },
|
||||
{"98 April 17 21:01:22", -1 },
|
||||
{"Thu, 012-Aug-2008 20:49:07 GMT", 1218574147 },
|
||||
{"Thu, 999999999999-Aug-2007 20:49:07 GMT", -1 },
|
||||
{"Thu, 12-Aug-2007 20:61:99999999999 GMT", -1 },
|
||||
{"IAintNoDateFool", -1 },
|
||||
{"Thu Apr 18 22:50 2007 GMT", 1176936600 },
|
||||
{"20110623 12:34:56", 1308832496 },
|
||||
{"20110632 12:34:56", -1 },
|
||||
{"20110623 56:34:56", -1 },
|
||||
{"20111323 12:34:56", -1 },
|
||||
{"20110623 12:34:79", -1 },
|
||||
{"Wed, 31 Dec 2008 23:59:60 GMT", 1230768000 },
|
||||
{"Wed, 31 Dec 2008 23:59:61 GMT", -1 },
|
||||
{"Wed, 31 Dec 2008 24:00:00 GMT", -1 },
|
||||
{"Wed, 31 Dec 2008 23:60:59 GMT", -1 },
|
||||
{"20110623 12:3", 1308830580 },
|
||||
{"20110623 1:3", 1308790980 },
|
||||
{"20110623 1:30", 1308792600 },
|
||||
{"20110623 12:12:3", 1308831123 },
|
||||
{"20110623 01:12:3", 1308791523 },
|
||||
{"20110623 01:99:30", -1 },
|
||||
{"Thu, 01-Jan-1970 00:00:00 GMT", 0 },
|
||||
{"Thu, 31-Dec-1969 23:59:58 GMT", -2 },
|
||||
{"Thu, 31-Dec-1969 23:59:59 GMT", 0 }, /* avoids -1 ! */
|
||||
{ "Sat, 15-Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{ "15-Sat, Apr-17 21:01:22 GMT", 1492290082 },
|
||||
{ "15-Sat, Apr 21:01:22 GMT 17", 1492290082 },
|
||||
{ "15-Sat, Apr 21:01:22 GMT 2017", 1492290082 },
|
||||
{ "15 Apr 21:01:22 2017", 1492290082 },
|
||||
{ "15 17 Apr 21:01:22", 1492290082 },
|
||||
{ "Apr 15 17 21:01:22", 1492290082 },
|
||||
{ "Apr 15 21:01:22 17", 1492290082 },
|
||||
{ "2017 April 15 21:01:22", -1 },
|
||||
{ "15 April 2017 21:01:22", -1 },
|
||||
{ "98 April 17 21:01:22", -1 },
|
||||
{ "Thu, 012-Aug-2008 20:49:07 GMT", 1218574147 },
|
||||
{ "Thu, 999999999999-Aug-2007 20:49:07 GMT", -1 },
|
||||
{ "Thu, 12-Aug-2007 20:61:99999999999 GMT", -1 },
|
||||
{ "IAintNoDateFool", -1 },
|
||||
{ "Thu Apr 18 22:50 2007 GMT", 1176936600 },
|
||||
{ "20110623 12:34:56", 1308832496 },
|
||||
{ "20110632 12:34:56", -1 },
|
||||
{ "20110623 56:34:56", -1 },
|
||||
{ "20111323 12:34:56", -1 },
|
||||
{ "20110623 12:34:79", -1 },
|
||||
{ "Wed, 31 Dec 2008 23:59:60 GMT", 1230768000 },
|
||||
{ "Wed, 31 Dec 2008 23:59:61 GMT", -1 },
|
||||
{ "Wed, 31 Dec 2008 24:00:00 GMT", -1 },
|
||||
{ "Wed, 31 Dec 2008 23:60:59 GMT", -1 },
|
||||
{ "20110623 12:3", 1308830580 },
|
||||
{ "20110623 1:3", 1308790980 },
|
||||
{ "20110623 1:30", 1308792600 },
|
||||
{ "20110623 12:12:3", 1308831123 },
|
||||
{ "20110623 01:12:3", 1308791523 },
|
||||
{ "20110623 01:99:30", -1 },
|
||||
{ "Thu, 01-Jan-1970 00:00:00 GMT", 0 },
|
||||
{ "Thu, 31-Dec-1969 23:59:58 GMT", -2 },
|
||||
{ "Thu, 31-Dec-1969 23:59:59 GMT", 0 }, /* avoids -1 ! */
|
||||
#if SIZEOF_TIME_T > 4
|
||||
{"Sun, 06 Nov 2044 08:49:37 GMT", (time_t)2362034977LL },
|
||||
{"Sun, 06 Nov 3144 08:49:37 GMT", 37074617377 },
|
||||
{ "Sun, 06 Nov 2044 08:49:37 GMT", (time_t)2362034977LL },
|
||||
{ "Sun, 06 Nov 3144 08:49:37 GMT", 37074617377 },
|
||||
#ifndef HAVE_TIME_T_UNSIGNED
|
||||
{"Sun, 06 Nov 1900 08:49:37 GMT", (time_t)-2182259423LL },
|
||||
{"Sun, 06 Nov 1800 08:49:37 GMT", -5337933023 },
|
||||
{"Thu, 01-Jan-1583 00:00:00 GMT", -12212553600 },
|
||||
{ "Sun, 06 Nov 1900 08:49:37 GMT", (time_t)-2182259423LL },
|
||||
{ "Sun, 06 Nov 1800 08:49:37 GMT", -5337933023 },
|
||||
{ "Thu, 01-Jan-1583 00:00:00 GMT", -12212553600 },
|
||||
#endif /* HAVE_TIME_T_UNSIGNED */
|
||||
{"Thu, 01-Jan-1499 00:00:00 GMT", -1 },
|
||||
{ "Thu, 01-Jan-1499 00:00:00 GMT", -1 },
|
||||
#else
|
||||
{"Sun, 06 Nov 2044 08:49:37 GMT", -1 },
|
||||
{ "Sun, 06 Nov 2044 08:49:37 GMT", -1 },
|
||||
#endif /* SIZEOF_TIME_T > 4 */
|
||||
#ifndef HAVE_TIME_T_UNSIGNED
|
||||
{"Sun, 06 Nov 1968 08:49:37 GMT", -36342623 },
|
||||
{ "Sun, 06 Nov 1968 08:49:37 GMT", -36342623 },
|
||||
#endif /* !HAVE_TIME_T_UNSIGNED */
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
#define T518_SAFETY_MARGIN (16)
|
||||
|
||||
#define NUM_OPEN (FD_SETSIZE + 10)
|
||||
#define NUM_NEEDED (NUM_OPEN + T518_SAFETY_MARGIN)
|
||||
#define NUM_OPEN (FD_SETSIZE + 10)
|
||||
#define NUM_NEEDED (NUM_OPEN + T518_SAFETY_MARGIN)
|
||||
|
||||
#if defined(_WIN32) || defined(MSDOS)
|
||||
#define DEV_NULL "NUL"
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ static void t530_msg(const char *msg)
|
|||
curl_mfprintf(stderr, "%s %s\n", t530_tag(), msg);
|
||||
}
|
||||
|
||||
|
||||
struct t530_Sockets {
|
||||
curl_socket_t *sockets;
|
||||
int count; /* number of sockets actually stored in array */
|
||||
|
|
@ -285,9 +284,9 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at)
|
|||
CURLcode res = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
CURLM *multi = NULL;
|
||||
struct t530_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}};
|
||||
struct t530_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } };
|
||||
int success = 0;
|
||||
struct curltime timeout = {0};
|
||||
struct curltime timeout = { 0 };
|
||||
timeout.tv_sec = (time_t)-1;
|
||||
|
||||
/* set the limits */
|
||||
|
|
@ -328,7 +327,7 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at)
|
|||
while(!t530_checkForCompletion(multi, &success)) {
|
||||
fd_set readSet, writeSet;
|
||||
curl_socket_t maxFd = 0;
|
||||
struct timeval tv = {0};
|
||||
struct timeval tv = { 0 };
|
||||
tv.tv_sec = 10;
|
||||
|
||||
FD_ZERO(&readSet);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ static int t537_test_rlimit(int keep_open)
|
|||
/* If the OS allows a HUGE number of open files, we do not run.
|
||||
* Modern debian sid reports a limit of 134217724 and this tests
|
||||
* takes minutes. */
|
||||
#define LIMIT_CAP (256 * 1024)
|
||||
#define LIMIT_CAP (256 * 1024)
|
||||
if(rl.rlim_cur > LIMIT_CAP) {
|
||||
curl_mfprintf(stderr, "soft limit above %ld, not running\n",
|
||||
(long)LIMIT_CAP);
|
||||
|
|
|
|||
|
|
@ -28,9 +28,10 @@
|
|||
static CURLcode test_lib543(const char *URL)
|
||||
{
|
||||
static const unsigned char a[] = {
|
||||
0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1,
|
||||
0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa,
|
||||
0x1d, 0x57, 0xe1};
|
||||
0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1,
|
||||
0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa,
|
||||
0x1d, 0x57, 0xe1
|
||||
};
|
||||
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ static CURLcode test_lib544(const char *URL)
|
|||
'T', 'h', 'i', 's', '\0', ' ', 'i', 's', ' ', 't', 'e', 's', 't', ' ',
|
||||
'b', 'i', 'n', 'a', 'r', 'y', ' ', 'd', 'a', 't', 'a', ' ',
|
||||
'w', 'i', 't', 'h', ' ', 'a', 'n', ' ',
|
||||
'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L'};
|
||||
'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L'
|
||||
};
|
||||
|
||||
char teststring[sizeof(teststring_init)];
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static size_t myreadfunc(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
return size;
|
||||
}
|
||||
|
||||
#define NUM_HEADERS 8
|
||||
#define NUM_HEADERS 8
|
||||
#define SIZE_HEADERS 5000
|
||||
|
||||
static CURLcode test_lib553(const char *URL)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define BUFSZ 256
|
||||
#define BUFSZ 256
|
||||
|
||||
struct unsshort_st {
|
||||
unsigned short num; /* unsigned short */
|
||||
|
|
@ -1166,9 +1166,9 @@ static int test_width_precision(void)
|
|||
{
|
||||
/* 325 is max precision (and width) for a double */
|
||||
char larger[1024];
|
||||
#define SPACE60 " "
|
||||
#define SPACE60 " "
|
||||
#define SPACE300 SPACE60 SPACE60 SPACE60 SPACE60 SPACE60
|
||||
#define OK325 SPACE300 " 0"
|
||||
#define OK325 SPACE300 " 0"
|
||||
|
||||
int rc;
|
||||
int errors = 0;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
static CURLcode test_lib558(const char *URL)
|
||||
{
|
||||
unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7};
|
||||
unsigned char a[] = { 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7 };
|
||||
CURLcode res = CURLE_OK;
|
||||
char *ptr = NULL;
|
||||
int asize;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ static CURLcode test_lib576(const char *URL)
|
|||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
struct chunk_data chunk_data = {0, 0};
|
||||
struct chunk_data chunk_data = { 0, 0 };
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
|
|
|
|||
|
|
@ -229,9 +229,9 @@ static CURLcode test_lib582(const char *URL)
|
|||
int hd;
|
||||
struct_stat file_info;
|
||||
CURLM *multi = NULL;
|
||||
struct t582_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}};
|
||||
struct t582_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } };
|
||||
int success = 0;
|
||||
struct curltime timeout = {0};
|
||||
struct curltime timeout = { 0 };
|
||||
timeout.tv_sec = (time_t)-1;
|
||||
|
||||
assert(test_argc >= 5);
|
||||
|
|
@ -304,7 +304,7 @@ static CURLcode test_lib582(const char *URL)
|
|||
while(!t582_checkForCompletion(multi, &success)) {
|
||||
fd_set readSet, writeSet;
|
||||
curl_socket_t maxFd = 0;
|
||||
struct timeval tv = {0};
|
||||
struct timeval tv = { 0 };
|
||||
tv.tv_sec = 10;
|
||||
|
||||
FD_ZERO(&readSet);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ static CURLcode test_lib654(const char *URL)
|
|||
part = curl_mime_addpart(mime);
|
||||
curl_mime_filedata(part, libtest_arg2);
|
||||
part = curl_mime_addpart(mime);
|
||||
curl_mime_data_cb(part, (curl_off_t) -1, t654_read_cb, NULL,
|
||||
curl_mime_data_cb(part, (curl_off_t)-1, t654_read_cb, NULL,
|
||||
free_callback, &pooh);
|
||||
|
||||
/* Bind mime data to its easy handle. */
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
***************************************************************************/
|
||||
#include "first.h"
|
||||
|
||||
#define PAUSE_TIME 5
|
||||
#define PAUSE_TIME 5
|
||||
|
||||
struct t670_ReadThis {
|
||||
CURL *curl;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ static CURLcode test_lib678(const char *URL)
|
|||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
if(!strcmp("check", URL)) {
|
||||
CURLcode w = CURLE_OK;
|
||||
struct curl_blob blob = {0};
|
||||
struct curl_blob blob = { 0 };
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
w = curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob);
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@ static struct t758_ctx {
|
|||
|
||||
static const char *t758_tag(void)
|
||||
{
|
||||
curl_msnprintf(t758_ctx.buf, sizeof(t758_ctx.buf),
|
||||
"[T758-%d-%d] [%d/%d]",
|
||||
curl_msnprintf(t758_ctx.buf, sizeof(t758_ctx.buf), "[T758-%d-%d] [%d/%d]",
|
||||
t758_ctx.max_socket_calls, t758_ctx.max_timer_calls,
|
||||
t758_ctx.socket_calls, t758_ctx.timer_calls);
|
||||
return t758_ctx.buf;
|
||||
|
|
@ -204,8 +203,8 @@ static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg)
|
|||
{
|
||||
SSL *ssl;
|
||||
(void)arg;
|
||||
ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx,
|
||||
SSL_get_ex_data_X509_STORE_CTX_idx());
|
||||
ssl = (SSL *)X509_STORE_CTX_get_ex_data(
|
||||
ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
|
||||
t758_ctx.number_of_cert_verify_callbacks++;
|
||||
if(!t758_ctx.fake_async_cert_verification_pending) {
|
||||
t758_ctx.fake_async_cert_verification_pending = 1;
|
||||
|
|
@ -222,8 +221,8 @@ static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg)
|
|||
}
|
||||
}
|
||||
|
||||
static CURLcode
|
||||
t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *clientp)
|
||||
static CURLcode t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx,
|
||||
void *clientp)
|
||||
{
|
||||
SSL_CTX *ctx = (SSL_CTX *)ssl_ctx;
|
||||
(void)curl;
|
||||
|
|
@ -333,9 +332,9 @@ static CURLcode t758_one(const char *URL, int timer_fail_at,
|
|||
CURLcode res = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
CURLM *multi = NULL;
|
||||
struct t758_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}};
|
||||
struct t758_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } };
|
||||
int success = 0;
|
||||
struct curltime timeout = {0};
|
||||
struct curltime timeout = { 0 };
|
||||
timeout.tv_sec = (time_t)-1;
|
||||
|
||||
/* set the limits */
|
||||
|
|
@ -390,7 +389,7 @@ static CURLcode t758_one(const char *URL, int timer_fail_at,
|
|||
while(!t758_checkForCompletion(multi, &success)) {
|
||||
fd_set readSet, writeSet;
|
||||
curl_socket_t maxFd = 0;
|
||||
struct timeval tv = {0};
|
||||
struct timeval tv = { 0 };
|
||||
tv.tv_sec = 10;
|
||||
|
||||
if(t758_ctx.fake_async_cert_verification_pending &&
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
#ifndef CURL_STATICLIB
|
||||
|
||||
#if defined(_MSC_VER) && defined(_DLL)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4232) /* MSVC extension, dllimport identity */
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4232) /* MSVC extension, dllimport identity */
|
||||
#endif
|
||||
|
||||
/* when libcurl is *not* static and we build libtests, the global pointers in
|
||||
|
|
@ -44,7 +44,7 @@ curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup;
|
|||
curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
|
||||
|
||||
#if defined(_MSC_VER) && defined(_DLL)
|
||||
# pragma warning(pop)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif /* !CURL_STATICLIB */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue