mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:01:41 +03:00
tests: rename CURLMcode variables to mresult
This commit is contained in:
parent
0a26e3a660
commit
56f600ec23
255 changed files with 1771 additions and 1772 deletions
|
|
@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
|||
|
||||
</strippart>
|
||||
<stdout>
|
||||
res 0
|
||||
result 0
|
||||
status 302
|
||||
redirects 0
|
||||
effectiveurl http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
|||
|
||||
</strippart>
|
||||
<stdout>
|
||||
res 0
|
||||
result 0
|
||||
status 302
|
||||
redirects 0
|
||||
effectiveurl http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Accept: */*
|
|||
|
||||
</protocol>
|
||||
<stdout>
|
||||
res 0
|
||||
result 0
|
||||
status 200
|
||||
redirects 1
|
||||
effectiveurl http://%HOSTIP:%HTTPPORT/%20/with/%20space/%TESTNUMBER0002
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
size_t i;
|
||||
CURLMsg *msg;
|
||||
int rounds = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLU *cu;
|
||||
struct curl_slist *resolve = NULL;
|
||||
char resolve_buf[1024];
|
||||
|
|
@ -143,22 +143,22 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
cu = curl_url();
|
||||
if(!cu) {
|
||||
curl_mfprintf(stderr, "out of memory\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, url, 0)) {
|
||||
curl_mfprintf(stderr, "not a URL: '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) {
|
||||
curl_mfprintf(stderr, "could not get host of '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) {
|
||||
curl_mfprintf(stderr, "could not get port of '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
memset(&resolve, 0, sizeof(resolve));
|
||||
|
|
@ -190,7 +190,7 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
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;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_easy_setopt(handles[i].curl, CURLOPT_HTTP_VERSION, http_version);
|
||||
|
|
@ -199,14 +199,14 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
multi = curl_multi_init();
|
||||
if(!multi) {
|
||||
curl_mfprintf(stderr, "curl_multi_init() failed - bailing out\n");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for(i = 0; i < CURL_ARRAYSIZE(handles); i++) {
|
||||
if(curl_multi_add_handle(multi, handles[i].curl) != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_add_handle() failed - bailing out\n");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
curl_mfprintf(stderr, "INFO: multi_perform round %d\n", rounds);
|
||||
if(curl_multi_perform(multi, &still_running) != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_perform() failed - bailing out\n");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -245,14 +245,14 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
if(!as_expected) {
|
||||
curl_mfprintf(stderr, "ERROR: handles not in expected state "
|
||||
"after %d rounds\n", rounds);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(curl_multi_poll(multi, NULL, 0, 100, &numfds) != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_poll() failed - bailing out\n");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ static CURLcode test_cli_h2_pausing(const char *URL)
|
|||
"resumed=%d, result %d - wtf?\n", i,
|
||||
handles[i].paused,
|
||||
handles[i].resumed, msg->data.result);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -312,5 +312,5 @@ cleanup:
|
|||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static CURLcode test_cli_h2_serverpush(const char *URL)
|
|||
CURL *curl = NULL;
|
||||
CURLM *multi;
|
||||
int transfers = 1; /* we start with one */
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
debug_config.nohex = TRUE;
|
||||
debug_config.tracetime = FALSE;
|
||||
|
|
@ -125,19 +125,19 @@ static CURLcode test_cli_h2_serverpush(const char *URL)
|
|||
|
||||
multi = curl_multi_init();
|
||||
if(!multi) {
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(setup_h2_serverpush(curl, URL)) {
|
||||
curl_mfprintf(stderr, "failed\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -150,13 +150,13 @@ static CURLcode test_cli_h2_serverpush(const char *URL)
|
|||
do {
|
||||
struct CURLMsg *m;
|
||||
int still_running; /* keep number of running handles */
|
||||
CURLMcode mc = curl_multi_perform(multi, &still_running);
|
||||
CURLMcode mresult = curl_multi_perform(multi, &still_running);
|
||||
|
||||
if(still_running)
|
||||
/* wait for activity, timeout or "nothing" */
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
|
||||
if(mc)
|
||||
if(mresult)
|
||||
break;
|
||||
|
||||
/*
|
||||
|
|
@ -188,5 +188,5 @@ cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
|
|||
{
|
||||
CURLM *multi = NULL;
|
||||
CURL *curl;
|
||||
CURLMcode mc;
|
||||
CURLMcode mresult;
|
||||
int running_handles = 0, start_count, numfds;
|
||||
CURLMsg *msg;
|
||||
int msgs_in_queue;
|
||||
char range[128];
|
||||
CURLcode res = (CURLcode)1;
|
||||
CURLcode result = (CURLcode)1;
|
||||
|
||||
if(!URL) {
|
||||
curl_mfprintf(stderr, "need URL as argument\n");
|
||||
|
|
@ -85,28 +85,28 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
|
|||
(curl_off_t)16384);
|
||||
curl_easy_setopt(curl, CURLOPT_RANGE, range);
|
||||
|
||||
mc = curl_multi_add_handle(multi, curl);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_add_handle(multi, curl);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_add_handle: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
curl_easy_cleanup(curl);
|
||||
goto cleanup;
|
||||
}
|
||||
--start_count;
|
||||
}
|
||||
|
||||
mc = curl_multi_perform(multi, &running_handles);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_perform(multi, &running_handles);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_perform: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(running_handles) {
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_poll: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
|
|||
} while(running_handles > 0 || start_count);
|
||||
|
||||
curl_mfprintf(stderr, "exiting\n");
|
||||
res = CURLE_OK;
|
||||
result = CURLE_OK;
|
||||
|
||||
cleanup:
|
||||
|
||||
|
|
@ -167,5 +167,5 @@ cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ struct transfer_d {
|
|||
int resumed;
|
||||
int done;
|
||||
int checked_ssl;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
};
|
||||
|
||||
static size_t transfer_count_d = 1;
|
||||
|
|
@ -136,13 +136,13 @@ static int my_progress_d_cb(void *userdata,
|
|||
defined(USE_GNUTLS) || defined(USE_MBEDTLS) || defined(USE_RUSTLS)
|
||||
if(!t->checked_ssl && dlnow > 0) {
|
||||
struct curl_tlssessioninfo *tls;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
|
||||
t->checked_ssl = TRUE;
|
||||
res = curl_easy_getinfo(t->curl, CURLINFO_TLS_SSL_PTR, &tls);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(t->curl, CURLINFO_TLS_SSL_PTR, &tls);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr, "[t-%zu] info CURLINFO_TLS_SSL_PTR failed: %d\n",
|
||||
t->idx, res);
|
||||
t->idx, result);
|
||||
assert(0);
|
||||
}
|
||||
else {
|
||||
|
|
@ -292,7 +292,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
size_t max_host_conns = 0;
|
||||
size_t max_total_conns = 0;
|
||||
int fresh_connect = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
(void)URL;
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
switch(ch) {
|
||||
case 'h':
|
||||
usage_hx_download(NULL);
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto optcleanup;
|
||||
case 'a':
|
||||
abort_paused = 1;
|
||||
|
|
@ -358,14 +358,14 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
http_version = CURL_HTTP_VERSION_3ONLY;
|
||||
else {
|
||||
usage_hx_download("invalid http version");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto optcleanup;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
usage_hx_download("invalid option");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto optcleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -376,14 +376,14 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
|
||||
if(test_argc != 1) {
|
||||
usage_hx_download("not enough arguments");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto optcleanup;
|
||||
}
|
||||
url = test_argv[0];
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_global_init() failed\n");
|
||||
res = (CURLcode)3;
|
||||
result = (CURLcode)3;
|
||||
goto optcleanup;
|
||||
}
|
||||
|
||||
|
|
@ -393,7 +393,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
share = curl_share_init();
|
||||
if(!share) {
|
||||
curl_mfprintf(stderr, "error allocating share\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
|
||||
|
|
@ -406,7 +406,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
transfer_d = curlx_calloc(transfer_count_d, sizeof(*transfer_d));
|
||||
if(!transfer_d) {
|
||||
curl_mfprintf(stderr, "error allocating transfer structs\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
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;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_add_handle(multi, t->curl);
|
||||
|
|
@ -445,14 +445,14 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
|
||||
do {
|
||||
int still_running; /* keep number of running handles */
|
||||
CURLMcode mc = curl_multi_perform(multi, &still_running);
|
||||
CURLMcode mresult = curl_multi_perform(multi, &still_running);
|
||||
|
||||
if(still_running) {
|
||||
/* wait for activity, timeout or "nothing" */
|
||||
mc = curl_multi_poll(multi, NULL, 0, 500, NULL);
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 500, NULL);
|
||||
}
|
||||
|
||||
if(mc)
|
||||
if(mresult)
|
||||
break;
|
||||
|
||||
do {
|
||||
|
|
@ -465,9 +465,9 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
t = get_transfer_for_easy_d(easy);
|
||||
if(t) {
|
||||
t->done = 1;
|
||||
t->res = m->data.result;
|
||||
t->result = m->data.result;
|
||||
curl_mfprintf(stderr, "[t-%zu] FINISHED with result %d\n",
|
||||
t->idx, t->res);
|
||||
t->idx, t->result);
|
||||
if(use_earlydata) {
|
||||
curl_off_t sent;
|
||||
curl_easy_getinfo(easy, CURLINFO_EARLYDATA_SENT_T, &sent);
|
||||
|
|
@ -517,7 +517,7 @@ static CURLcode test_cli_hx_download(const char *URL)
|
|||
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;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_add_handle(multi, t->curl);
|
||||
|
|
@ -550,8 +550,8 @@ cleanup:
|
|||
curl_easy_cleanup(t->curl);
|
||||
t->curl = NULL;
|
||||
}
|
||||
if(t->res)
|
||||
res = t->res;
|
||||
if(t->result)
|
||||
result = t->result;
|
||||
else /* on success we expect ssl to have been checked */
|
||||
assert(t->checked_ssl);
|
||||
}
|
||||
|
|
@ -567,5 +567,5 @@ optcleanup:
|
|||
|
||||
curlx_free(resolve);
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
struct curl_slist *host = NULL;
|
||||
const char *resolve = NULL;
|
||||
int ch;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
(void)URL;
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
share = curl_share_init();
|
||||
if(!share) {
|
||||
curl_mfprintf(stderr, "error allocating share\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
|
||||
|
|
@ -360,7 +360,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
transfer_u = curlx_calloc(transfer_count_u, sizeof(*transfer_u));
|
||||
if(!transfer_u) {
|
||||
curl_mfprintf(stderr, "error allocating transfer structs\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
curl_mfprintf(stderr, "failed to init easy handle\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
for(i = 0; i < transfer_count_u; ++i) {
|
||||
|
|
@ -389,7 +389,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
if(setup_hx_upload(t->curl, url, t, http_version, host, share,
|
||||
use_earlydata, announce_length)) {
|
||||
curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +412,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
if(!t->curl || setup_hx_upload(t->curl, url, t, http_version, host,
|
||||
share, use_earlydata, announce_length)) {
|
||||
curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_add_handle(multi, t->curl);
|
||||
|
|
@ -423,15 +423,15 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
|
||||
do {
|
||||
int still_running; /* keep number of running handles */
|
||||
CURLMcode mc = curl_multi_perform(multi, &still_running);
|
||||
CURLMcode mresult = curl_multi_perform(multi, &still_running);
|
||||
struct CURLMsg *m;
|
||||
|
||||
if(still_running) {
|
||||
/* wait for activity, timeout or "nothing" */
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
}
|
||||
|
||||
if(mc)
|
||||
if(mresult)
|
||||
break;
|
||||
|
||||
do {
|
||||
|
|
@ -498,7 +498,7 @@ static CURLcode test_cli_hx_upload(const char *URL)
|
|||
host, share, use_earlydata,
|
||||
announce_length)) {
|
||||
curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
curl_multi_add_handle(multi, t->curl);
|
||||
|
|
@ -544,5 +544,5 @@ cleanup:
|
|||
curl_slist_free_all(host);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static CURL *tse_add_transfer(CURLM *multi, CURLSH *share,
|
|||
const char *url, long http_version)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLMcode mc;
|
||||
CURLMcode mresult;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
|
|
@ -83,10 +83,10 @@ static CURL *tse_add_transfer(CURLM *multi, CURLSH *share,
|
|||
if(resolve)
|
||||
curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve);
|
||||
|
||||
mc = curl_multi_add_handle(multi, curl);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_add_handle(multi, curl);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_add_handle: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
curl_easy_cleanup(curl);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ static CURL *tse_add_transfer(CURLM *multi, CURLSH *share,
|
|||
static CURLcode test_cli_tls_session_reuse(const char *URL)
|
||||
{
|
||||
CURLM *multi = NULL;
|
||||
CURLMcode mc;
|
||||
CURLMcode mresult;
|
||||
int running_handles = 0, numfds;
|
||||
CURLMsg *msg;
|
||||
CURLSH *share = NULL;
|
||||
|
|
@ -107,7 +107,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
|
|||
int add_more, waits, ongoing = 0;
|
||||
char *host = NULL, *port = NULL;
|
||||
long http_version = CURL_HTTP_VERSION_1_1;
|
||||
CURLcode res = (CURLcode)1;
|
||||
CURLcode result = (CURLcode)1;
|
||||
|
||||
if(!URL || !libtest_arg2) {
|
||||
curl_mfprintf(stderr, "need args: URL proto\n");
|
||||
|
|
@ -127,7 +127,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
|
|||
cu = curl_url();
|
||||
if(!cu) {
|
||||
curl_mfprintf(stderr, "out of memory\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, URL, 0)) {
|
||||
|
|
@ -166,18 +166,18 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
|
|||
add_more = 6;
|
||||
waits = 3;
|
||||
do {
|
||||
mc = curl_multi_perform(multi, &running_handles);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_perform(multi, &running_handles);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_perform: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(running_handles) {
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mc != CURLM_OK) {
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 1000000, &numfds);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_poll: %s\n",
|
||||
curl_multi_strerror(mc));
|
||||
curl_multi_strerror(mresult));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -233,12 +233,12 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
|
|||
|
||||
if(!tse_found_tls_session) {
|
||||
curl_mfprintf(stderr, "CURLINFO_TLS_SSL_PTR not found during run\n");
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
curl_mfprintf(stderr, "exiting\n");
|
||||
res = CURLE_OK;
|
||||
result = CURLE_OK;
|
||||
|
||||
cleanup:
|
||||
|
||||
|
|
@ -262,5 +262,5 @@ cleanup:
|
|||
curl_url_cleanup(cu);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static void usage_upload_pausing(const char *msg)
|
|||
static CURLcode test_cli_upload_pausing(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLU *cu;
|
||||
struct curl_slist *resolve = NULL;
|
||||
char resolve_buf[1024];
|
||||
|
|
@ -135,22 +135,22 @@ static CURLcode test_cli_upload_pausing(const char *URL)
|
|||
cu = curl_url();
|
||||
if(!cu) {
|
||||
curl_mfprintf(stderr, "out of memory\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_set(cu, CURLUPART_URL, url, 0)) {
|
||||
curl_mfprintf(stderr, "not a URL: '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) {
|
||||
curl_mfprintf(stderr, "could not get host of '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) {
|
||||
curl_mfprintf(stderr, "could not get port of '%s'\n", url);
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
memset(&resolve, 0, sizeof(resolve));
|
||||
|
|
@ -161,7 +161,7 @@ static CURLcode test_cli_upload_pausing(const char *URL)
|
|||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
curl_mfprintf(stderr, "out of memory\n");
|
||||
res = (CURLcode)1;
|
||||
result = (CURLcode)1;
|
||||
goto cleanup;
|
||||
}
|
||||
/* We want to use our own read function. */
|
||||
|
|
@ -189,14 +189,14 @@ static CURLcode test_cli_upload_pausing(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) != CURLE_OK ||
|
||||
curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "something unexpected went wrong - bailing out!\n");
|
||||
res = (CURLcode)2;
|
||||
result = (CURLcode)2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
cleanup:
|
||||
|
||||
|
|
@ -209,5 +209,5 @@ cleanup:
|
|||
curl_url_cleanup(cu);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ static CURLcode test_ws_data_m1_echo(const char *url,
|
|||
size_t plen_max)
|
||||
{
|
||||
CURLM *multi = NULL;
|
||||
CURLcode r = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct test_ws_m1_ctx m1_ctx;
|
||||
size_t i, len;
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ static CURLcode test_ws_data_m1_echo(const char *url,
|
|||
m1_ctx.send_buf = curlx_calloc(1, plen_max + 1);
|
||||
m1_ctx.recv_buf = curlx_calloc(1, plen_max + 1);
|
||||
if(!m1_ctx.send_buf || !m1_ctx.recv_buf) {
|
||||
r = CURLE_OUT_OF_MEMORY;
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
for(i = 0; i < plen_max; ++i) {
|
||||
|
|
@ -304,13 +304,13 @@ static CURLcode test_ws_data_m1_echo(const char *url,
|
|||
|
||||
multi = curl_multi_init();
|
||||
if(!multi) {
|
||||
r = CURLE_OUT_OF_MEMORY;
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
m1_ctx.curl = curl_easy_init();
|
||||
if(!m1_ctx.curl) {
|
||||
r = CURLE_OUT_OF_MEMORY;
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
@ -347,18 +347,18 @@ static CURLcode test_ws_data_m1_echo(const char *url,
|
|||
|
||||
while(1) {
|
||||
int still_running; /* keep number of running handles */
|
||||
CURLMcode mc = curl_multi_perform(multi, &still_running);
|
||||
CURLMcode mresult = curl_multi_perform(multi, &still_running);
|
||||
|
||||
if(!still_running || (m1_ctx.frames_written >= m1_ctx.nframes)) {
|
||||
/* got the full echo back or failed */
|
||||
break;
|
||||
}
|
||||
|
||||
if(!mc && still_running) {
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1, NULL);
|
||||
if(!mresult && still_running) {
|
||||
mresult = curl_multi_poll(multi, NULL, 0, 1, NULL);
|
||||
}
|
||||
if(mc) {
|
||||
r = CURLE_RECV_ERROR;
|
||||
if(mresult) {
|
||||
result = CURLE_RECV_ERROR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
@ -369,13 +369,13 @@ static CURLcode test_ws_data_m1_echo(const char *url,
|
|||
if(m1_ctx.frames_read < m1_ctx.nframes) {
|
||||
curl_mfprintf(stderr, "m1_echo, sent only %d/%d frames\n",
|
||||
m1_ctx.frames_read, m1_ctx.nframes);
|
||||
r = CURLE_SEND_ERROR;
|
||||
result = CURLE_SEND_ERROR;
|
||||
goto out;
|
||||
}
|
||||
if(m1_ctx.frames_written < m1_ctx.frames_read) {
|
||||
curl_mfprintf(stderr, "m1_echo, received only %d/%d frames\n",
|
||||
m1_ctx.frames_written, m1_ctx.frames_read);
|
||||
r = CURLE_RECV_ERROR;
|
||||
result = CURLE_RECV_ERROR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
@ -388,7 +388,7 @@ out:
|
|||
}
|
||||
curlx_free(m1_ctx.send_buf);
|
||||
curlx_free(m1_ctx.recv_buf);
|
||||
return r;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void test_ws_data_usage(const char *msg)
|
||||
|
|
@ -407,7 +407,7 @@ static void test_ws_data_usage(const char *msg)
|
|||
static CURLcode test_cli_ws_data(const char *URL)
|
||||
{
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
const char *url;
|
||||
size_t plen_min = 0, plen_max = 0, count = 1;
|
||||
int ch, model = 2;
|
||||
|
|
@ -468,13 +468,13 @@ static CURLcode test_cli_ws_data(const char *URL)
|
|||
}
|
||||
|
||||
if(model == 1)
|
||||
res = test_ws_data_m1_echo(url, plen_min, plen_max);
|
||||
result = test_ws_data_m1_echo(url, plen_min, plen_max);
|
||||
else
|
||||
res = test_ws_data_m2_echo(url, count, plen_min, plen_max);
|
||||
result = test_ws_data_m2_echo(url, count, plen_min, plen_max);
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
|
||||
#else /* !CURL_DISABLE_WEBSOCKETS */
|
||||
(void)URL;
|
||||
|
|
|
|||
|
|
@ -29,21 +29,21 @@
|
|||
|
||||
static CURLcode pingpong(CURL *curl, const char *payload)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
int i;
|
||||
|
||||
res = ws_send_ping(curl, payload);
|
||||
if(res)
|
||||
return res;
|
||||
result = ws_send_ping(curl, payload);
|
||||
if(result)
|
||||
return result;
|
||||
for(i = 0; i < 10; ++i) {
|
||||
curl_mfprintf(stderr, "Receive pong\n");
|
||||
res = ws_recv_pong(curl, payload);
|
||||
if(res == CURLE_AGAIN) {
|
||||
result = ws_recv_pong(curl, payload);
|
||||
if(result == CURLE_AGAIN) {
|
||||
curlx_wait_ms(100);
|
||||
continue;
|
||||
}
|
||||
ws_close(curl);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
ws_close(curl);
|
||||
return CURLE_RECV_ERROR;
|
||||
|
|
@ -55,7 +55,7 @@ static CURLcode test_cli_ws_pingpong(const char *URL)
|
|||
{
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
const char *payload;
|
||||
|
||||
if(!URL || !libtest_arg2) {
|
||||
|
|
@ -77,16 +77,16 @@ static CURLcode test_cli_ws_pingpong(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "ws-pingpong");
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */
|
||||
res = curl_easy_perform(curl);
|
||||
curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", res);
|
||||
if(res == CURLE_OK)
|
||||
res = pingpong(curl, payload);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", result);
|
||||
if(result == CURLE_OK)
|
||||
result = pingpong(curl, payload);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
|
||||
#else /* !CURL_DISABLE_WEBSOCKETS */
|
||||
(void)URL;
|
||||
|
|
|
|||
|
|
@ -161,10 +161,11 @@ char *hexdump(const unsigned char *buf, size_t len)
|
|||
CURLcode ws_send_ping(CURL *curl, const char *send_payload)
|
||||
{
|
||||
size_t sent;
|
||||
CURLcode res = curl_ws_send(curl, send_payload, strlen(send_payload),
|
||||
&sent, 0, CURLWS_PING);
|
||||
curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", res, sent);
|
||||
return res;
|
||||
CURLcode result = curl_ws_send(curl, send_payload, strlen(send_payload),
|
||||
&sent, 0, CURLWS_PING);
|
||||
curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n",
|
||||
result, sent);
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
|
||||
|
|
@ -172,11 +173,11 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
|
|||
size_t rlen;
|
||||
const struct curl_ws_frame *meta;
|
||||
char buffer[256];
|
||||
CURLcode res = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta);
|
||||
if(res) {
|
||||
CURLcode result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr, "ws: curl_ws_recv returned %u, received %zu\n",
|
||||
res, rlen);
|
||||
return res;
|
||||
result, rlen);
|
||||
return result;
|
||||
}
|
||||
|
||||
if(!(meta->flags & CURLWS_PONG)) {
|
||||
|
|
@ -189,7 +190,7 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
|
|||
if(rlen == strlen(expected_payload) &&
|
||||
!memcmp(expected_payload, buffer, rlen)) {
|
||||
curl_mfprintf(stderr, "ws: got the same payload back\n");
|
||||
return CURLE_OK; /* lib2304 returned 'res' here. Intentional? */
|
||||
return CURLE_OK;
|
||||
}
|
||||
curl_mfprintf(stderr, "ws: did NOT get the same payload back\n");
|
||||
return CURLE_RECV_ERROR;
|
||||
|
|
@ -199,15 +200,16 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
|
|||
void ws_close(CURL *curl)
|
||||
{
|
||||
size_t sent;
|
||||
CURLcode res = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE);
|
||||
curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", res, sent);
|
||||
CURLcode result = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE);
|
||||
curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n",
|
||||
result, sent);
|
||||
}
|
||||
#endif /* CURL_DISABLE_WEBSOCKETS */
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
const char *URL = "";
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
entry_func_t entry_func;
|
||||
const char *entry_name;
|
||||
const char *env;
|
||||
|
|
@ -274,8 +276,8 @@ int main(int argc, const char **argv)
|
|||
testnum = (int)num;
|
||||
}
|
||||
|
||||
res = entry_func(URL);
|
||||
curl_mfprintf(stderr, "Test ended with result %d\n", res);
|
||||
result = entry_func(URL);
|
||||
curl_mfprintf(stderr, "Test ended with result %d\n", result);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* flush buffers of all streams regardless of mode */
|
||||
|
|
@ -284,5 +286,5 @@ int main(int argc, const char **argv)
|
|||
|
||||
/* Regular program status codes are limited to 0..127 and 126 and 127 have
|
||||
* special meanings by the shell, so limit a normal return code to 125 */
|
||||
return (int)res <= 125 ? (int)res : 125;
|
||||
return (int)result <= 125 ? (int)result : 125;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ extern int unitfail; /* for unittests */
|
|||
#define CURL_GNUC_DIAG
|
||||
#endif
|
||||
|
||||
#define test_setopt(A, B, C) \
|
||||
if((res = curl_easy_setopt(A, B, C)) != CURLE_OK) \
|
||||
#define test_setopt(A, B, C) \
|
||||
if((result = curl_easy_setopt(A, B, C)) != CURLE_OK) \
|
||||
goto test_cleanup
|
||||
|
||||
#define test_multi_setopt(A, B, C) \
|
||||
if((res = curl_multi_setopt(A, B, C)) != CURLE_OK) \
|
||||
#define test_multi_setopt(A, B, C) \
|
||||
if((result = curl_multi_setopt(A, B, C)) != CURLE_OK) \
|
||||
goto test_cleanup
|
||||
|
||||
extern const char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
|
||||
|
|
@ -148,7 +148,7 @@ void ws_close(CURL *curl);
|
|||
do { \
|
||||
if(((A) = curl_easy_init()) == NULL) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", Y, Z); \
|
||||
res = TEST_ERR_EASY_INIT; \
|
||||
result = TEST_ERR_EASY_INIT; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_easy_init(A, Y, Z) \
|
||||
do { \
|
||||
exe_easy_init(A, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ void ws_close(CURL *curl);
|
|||
do { \
|
||||
if(((A) = curl_multi_init()) == NULL) { \
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", Y, Z); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_init(A, Y, Z) \
|
||||
do { \
|
||||
exe_multi_init(A, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_easy_setopt() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_easy_strerror(ec)); \
|
||||
res = ec; \
|
||||
result = ec; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_easy_setopt(A, B, C, Y, Z) \
|
||||
do { \
|
||||
exe_easy_setopt(A, B, C, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_setopt() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_setopt(A, B, C, Y, Z) \
|
||||
do { \
|
||||
exe_multi_setopt(A, B, C, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_add_handle() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_add_handle(A, B, Y, Z) \
|
||||
do { \
|
||||
exe_multi_add_handle(A, B, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_remove_handle() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_remove_handle(A, B, Y, Z) \
|
||||
do { \
|
||||
exe_multi_remove_handle(A, B, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -298,23 +298,23 @@ void ws_close(CURL *curl);
|
|||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#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, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
} \
|
||||
else if(*(B) < 0) { \
|
||||
curl_mfprintf(stderr, \
|
||||
"%s:%d curl_multi_perform() succeeded, " \
|
||||
#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, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
else if(*(B) < 0) { \
|
||||
curl_mfprintf(stderr, \
|
||||
"%s:%d curl_multi_perform() succeeded, " \
|
||||
"but returned invalid running_handles value (%d)\n", \
|
||||
Y, Z, (int)*(B)); \
|
||||
res = TEST_ERR_NUM_HANDLES; \
|
||||
} \
|
||||
Y, Z, (int)*(B)); \
|
||||
result = TEST_ERR_NUM_HANDLES; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define res_multi_perform(A, B) \
|
||||
|
|
@ -323,7 +323,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_perform(A, B, Y, Z) \
|
||||
do { \
|
||||
exe_multi_perform(A, B, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -340,14 +340,14 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_fdset() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
else if(*(E) < -1) { \
|
||||
curl_mfprintf(stderr, \
|
||||
"%s:%d curl_multi_fdset() succeeded, " \
|
||||
"but returned invalid max_fd value (%d)\n", \
|
||||
Y, Z, (int)*(E)); \
|
||||
res = TEST_ERR_NUM_HANDLES; \
|
||||
result = TEST_ERR_NUM_HANDLES; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_fdset(A, B, C, D, E, Y, Z) \
|
||||
do { \
|
||||
exe_multi_fdset(A, B, C, D, E, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -374,14 +374,14 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_timeout() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_BAD_TIMEOUT; \
|
||||
result = TEST_ERR_BAD_TIMEOUT; \
|
||||
} \
|
||||
else if(*(B) < -1L) { \
|
||||
curl_mfprintf(stderr, \
|
||||
"%s:%d curl_multi_timeout() succeeded, " \
|
||||
"but returned invalid timeout value (%ld)\n", \
|
||||
Y, Z, (long)*(B)); \
|
||||
res = TEST_ERR_BAD_TIMEOUT; \
|
||||
result = TEST_ERR_BAD_TIMEOUT; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_timeout(A, B, Y, Z) \
|
||||
do { \
|
||||
exe_multi_timeout(A, B, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -408,14 +408,14 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_poll() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
else if(*(E) < 0) { \
|
||||
curl_mfprintf(stderr, \
|
||||
"%s:%d curl_multi_poll() succeeded, " \
|
||||
"but returned invalid numfds value (%d)\n", \
|
||||
Y, Z, (int)*(E)); \
|
||||
res = TEST_ERR_NUM_HANDLES; \
|
||||
result = TEST_ERR_NUM_HANDLES; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_poll(A, B, C, D, E, Y, Z) \
|
||||
do { \
|
||||
exe_multi_poll(A, B, C, D, E, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_multi_wakeup() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_multi_strerror(ec)); \
|
||||
res = TEST_ERR_MULTI; \
|
||||
result = TEST_ERR_MULTI; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -452,7 +452,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_multi_wakeup(A, Y, Z) \
|
||||
do { \
|
||||
exe_multi_wakeup(A, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d select() failed, with " \
|
||||
"errno %d (%s)\n", \
|
||||
Y, Z, ec, curlx_strerror(ec, ecbuf, sizeof(ecbuf))); \
|
||||
res = TEST_ERR_SELECT; \
|
||||
result = TEST_ERR_SELECT; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_select_test(A, B, C, D, E, Y, Z) \
|
||||
do { \
|
||||
exe_select_test(A, B, C, D, E, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d ABORTING TEST, since it seems " \
|
||||
"that it would have run forever (%ld ms > %ld ms)\n", \
|
||||
Y, Z, (long)timediff, (long)(TEST_HANG_TIMEOUT)); \
|
||||
res = TEST_ERR_RUNS_FOREVER; \
|
||||
result = TEST_ERR_RUNS_FOREVER; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -518,7 +518,7 @@ void ws_close(CURL *curl);
|
|||
#define chk_test_timedout(T, Y, Z) \
|
||||
do { \
|
||||
exe_test_timedout(T, Y, Z); \
|
||||
if(res) \
|
||||
if(result) \
|
||||
goto test_cleanup; \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ void ws_close(CURL *curl);
|
|||
"%s:%d curl_global_init() failed, " \
|
||||
"with code %d (%s)\n", \
|
||||
Y, Z, ec, curl_easy_strerror(ec)); \
|
||||
res = ec; \
|
||||
result = ec; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -548,8 +548,8 @@ void ws_close(CURL *curl);
|
|||
#define chk_global_init(A, Y, Z) \
|
||||
do { \
|
||||
exe_global_init(A, Y, Z); \
|
||||
if(res) \
|
||||
return res; \
|
||||
if(result) \
|
||||
return result; \
|
||||
} while(0)
|
||||
|
||||
/* global_init() is different than other macros. In case of
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
struct testparams {
|
||||
unsigned int flags; /* ORed flags as above. */
|
||||
CURLcode res; /* Code that should be returned by curl_easy_perform(). */
|
||||
CURLcode result; /* Code that should be returned by curl_easy_perform(). */
|
||||
};
|
||||
|
||||
static const struct testparams testparams[] = {
|
||||
|
|
@ -84,7 +84,7 @@ static size_t writedata(char *data, size_t size, size_t nmemb, void *userdata)
|
|||
static int onetest(CURL *curl, const char *url, const struct testparams *p,
|
||||
size_t num)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
unsigned int replyselector;
|
||||
char urlbuf[256];
|
||||
|
||||
|
|
@ -99,15 +99,15 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p,
|
|||
"3-1000000" : (char *)NULL);
|
||||
test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL) ? 1L : 0L);
|
||||
hasbody = 0;
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != p->res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result != p->result) {
|
||||
curl_mprintf("%zu: bad error code (%d): resume=%s, fail=%s, http416=%s, "
|
||||
"content-range=%s, expected=%d\n", num, res,
|
||||
"content-range=%s, expected=%d\n", num, result,
|
||||
(p->flags & F_RESUME) ? "yes" : "no",
|
||||
(p->flags & F_FAIL) ? "yes" : "no",
|
||||
(p->flags & F_HTTP416) ? "yes" : "no",
|
||||
(p->flags & F_CONTENTRANGE) ? "yes" : "no",
|
||||
p->res);
|
||||
p->result);
|
||||
return 1;
|
||||
}
|
||||
if(hasbody && (p->flags & F_IGNOREBODY)) {
|
||||
|
|
@ -131,7 +131,7 @@ test_cleanup:
|
|||
|
||||
static CURLcode test_lib1156(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
size_t i;
|
||||
int status = 0;
|
||||
|
|
@ -167,5 +167,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static CURLcode test_lib1308(const char *URL)
|
|||
{
|
||||
int errorcount = 0;
|
||||
CURLFORMcode rc;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
int formres = 0;
|
||||
struct curl_httppost *post = NULL;
|
||||
struct curl_httppost *last = NULL;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct t1485_transfer_status {
|
|||
CURL *curl;
|
||||
curl_off_t out_len;
|
||||
size_t hd_line;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
int http_status;
|
||||
};
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb,
|
|||
struct t1485_transfer_status *st = (struct t1485_transfer_status *)userp;
|
||||
const char *hd = ptr;
|
||||
size_t len = size * nmemb;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
|
||||
(void)fwrite(ptr, size, nmemb, stdout);
|
||||
++st->hd_line;
|
||||
|
|
@ -45,22 +45,22 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb,
|
|||
curl_off_t clen;
|
||||
long httpcode = 0;
|
||||
/* end of a response */
|
||||
res = curl_easy_getinfo(st->curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
result = curl_easy_getinfo(st->curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
curl_mfprintf(stderr, "header_callback, get status: %ld, %d\n",
|
||||
httpcode, res);
|
||||
httpcode, result);
|
||||
if(httpcode < 100 || httpcode >= 1000) {
|
||||
curl_mfprintf(stderr, "header_callback, invalid status: %ld, %d\n",
|
||||
httpcode, res);
|
||||
httpcode, result);
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
st->http_status = (int)httpcode;
|
||||
if(st->http_status >= 200 && st->http_status < 300) {
|
||||
res = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
|
||||
result = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
|
||||
&clen);
|
||||
curl_mfprintf(stderr, "header_callback, info Content-Length: "
|
||||
"%" CURL_FORMAT_CURL_OFF_T ", %d\n", clen, res);
|
||||
if(res) {
|
||||
st->res = res;
|
||||
"%" CURL_FORMAT_CURL_OFF_T ", %d\n", clen, result);
|
||||
if(result) {
|
||||
st->result = result;
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
if(clen < 0) {
|
||||
|
|
@ -86,7 +86,7 @@ static size_t t1485_write_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
static CURLcode test_lib1485(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct t1485_transfer_status st;
|
||||
|
||||
start_test_timing();
|
||||
|
|
@ -106,12 +106,12 @@ static CURLcode test_lib1485(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res; /* return the final return code */
|
||||
return result; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1500(const char *URL)
|
|||
CURLM *multi = NULL;
|
||||
int still_running;
|
||||
CURLcode i = TEST_ERR_FAILURE;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLMsg *msg;
|
||||
|
||||
start_test_timing();
|
||||
|
|
@ -50,12 +50,12 @@ static CURLcode test_lib1500(const char *URL)
|
|||
abort_on_test_timeout();
|
||||
|
||||
while(still_running) {
|
||||
CURLMcode mres;
|
||||
CURLMcode mresult;
|
||||
int num;
|
||||
mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mres != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mres);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
mresult = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mresult);
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -80,8 +80,8 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
if(res)
|
||||
i = res;
|
||||
if(result)
|
||||
i = result;
|
||||
|
||||
return i; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ static CURLcode test_lib1501(const char *URL)
|
|||
|
||||
CURL *curl = NULL;
|
||||
CURLM *multi = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
int still_running = 0;
|
||||
|
||||
start_test_timing();
|
||||
|
|
@ -89,7 +89,7 @@ static CURLcode test_lib1501(const char *URL)
|
|||
curl_mfprintf(stderr, "pong = %ld\n", (long)e);
|
||||
|
||||
if(e > MAX_BLOCKED_TIME_MS) {
|
||||
res = CURLE_TOO_LARGE;
|
||||
result = CURLE_TOO_LARGE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -102,5 +102,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,15 +37,15 @@ static CURLcode test_lib1502(const char *URL)
|
|||
CURL *curldupe;
|
||||
CURLM *multi = NULL;
|
||||
int still_running;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
char redirect[160];
|
||||
|
||||
/* DNS cache injection */
|
||||
struct curl_slist *dns_cache_list;
|
||||
|
||||
res_global_init(CURL_GLOBAL_ALL);
|
||||
if(res) {
|
||||
return res;
|
||||
if(result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
curl_msnprintf(redirect, sizeof(redirect), "google.com:%s:%s", libtest_arg2,
|
||||
|
|
@ -146,5 +146,5 @@ test_cleanup:
|
|||
|
||||
curl_slist_free_all(dns_cache_list);
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1506(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl[NUM_HANDLES] = { 0 };
|
||||
int running;
|
||||
CURLM *multi = NULL;
|
||||
|
|
@ -127,5 +127,5 @@ test_cleanup:
|
|||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ static CURLcode test_lib1507(const char *URL)
|
|||
{
|
||||
static const int MULTI_PERFORM_HANG_TIMEOUT = 60 * 1000;
|
||||
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
CURLM *multi = NULL;
|
||||
int still_running = 1;
|
||||
|
|
@ -135,5 +135,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1508(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLM *multi = NULL;
|
||||
|
||||
(void)URL;
|
||||
|
|
@ -43,5 +43,5 @@ test_cleanup:
|
|||
|
||||
curl_mprintf("We are done\n");
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static CURLcode test_lib1509(const char *URL)
|
|||
long headerSize;
|
||||
CURLcode code;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ static CURLcode test_lib1509(const char *URL)
|
|||
curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed, "
|
||||
"with code %d (%s)\n",
|
||||
__FILE__, __LINE__, code, curl_easy_strerror(code));
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ static CURLcode test_lib1509(const char *URL)
|
|||
curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed, "
|
||||
"with code %d (%s)\n",
|
||||
__FILE__, __LINE__, code, curl_easy_strerror(code));
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -88,5 +88,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static CURLcode test_lib1510(const char *URL)
|
|||
{
|
||||
static const int NUM_URLS = 4;
|
||||
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
int i;
|
||||
char target_url[256];
|
||||
|
|
@ -76,8 +76,8 @@ static CURLcode test_lib1510(const char *URL)
|
|||
target_url[sizeof(target_url) - 1] = '\0';
|
||||
easy_setopt(curl, CURLOPT_URL, target_url);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
|
@ -93,5 +93,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static CURLcode test_lib1511(const char *URL)
|
|||
{
|
||||
long unmet;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -40,30 +40,30 @@ static CURLcode test_lib1511(const char *URL)
|
|||
/* TIMEVALUE in the future */
|
||||
easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(unmet != 1L) {
|
||||
res = TEST_ERR_FAILURE; /* not correct */
|
||||
result = TEST_ERR_FAILURE; /* not correct */
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
/* TIMEVALUE in the past */
|
||||
easy_setopt(curl, CURLOPT_TIMEVALUE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(unmet) {
|
||||
res = TEST_ERR_FAILURE; /* not correct */
|
||||
result = TEST_ERR_FAILURE; /* not correct */
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = TEST_ERR_SUCCESS; /* this is where we should be */
|
||||
result = TEST_ERR_SUCCESS; /* this is where we should be */
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -71,5 +71,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
static CURLcode test_lib1512(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl[2] = { NULL, NULL };
|
||||
const char *port = libtest_arg3;
|
||||
const char *address = libtest_arg2;
|
||||
|
|
@ -74,9 +74,9 @@ static CURLcode test_lib1512(const char *URL)
|
|||
easy_setopt(curl[0], CURLOPT_RESOLVE, slist);
|
||||
|
||||
/* run each transfer */
|
||||
for(i = 0; (i < CURL_ARRAYSIZE(curl)) && !res; i++) {
|
||||
res = curl_easy_perform(curl[i]);
|
||||
if(res)
|
||||
for(i = 0; (i < CURL_ARRAYSIZE(curl)) && !result; i++) {
|
||||
result = curl_easy_perform(curl[i]);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -87,5 +87,5 @@ test_cleanup:
|
|||
curl_slist_free_all(slist);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static int progressKiller(void *arg,
|
|||
static CURLcode test_lib1513(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ static CURLcode test_lib1513(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL);
|
||||
easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -70,5 +70,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static size_t t1514_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
static CURLcode test_lib1514(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
static char testdata[] = "dummy";
|
||||
|
||||
|
|
@ -74,12 +74,12 @@ static CURLcode test_lib1514(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||
}
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ static CURLcode do_one_request(CURLM *multi, const char *URL,
|
|||
CURL *curl;
|
||||
struct curl_slist *resolve_list = NULL;
|
||||
int still_running;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLMsg *msg;
|
||||
int msgs_left;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ static CURLcode do_one_request(CURLM *multi, const char *URL,
|
|||
do {
|
||||
msg = curl_multi_info_read(multi, &msgs_left);
|
||||
if(msg && msg->msg == CURLMSG_DONE && msg->easy_handle == curl) {
|
||||
res = msg->data.result;
|
||||
result = msg->data.result;
|
||||
break;
|
||||
}
|
||||
} while(msg);
|
||||
|
|
@ -97,13 +97,13 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_slist_free_all(resolve_list);
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode test_lib1515(const char *URL)
|
||||
{
|
||||
CURLM *multi = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
const char *path = URL;
|
||||
const char *address = libtest_arg2;
|
||||
const char *port = libtest_arg3;
|
||||
|
|
@ -126,9 +126,9 @@ static CURLcode test_lib1515(const char *URL)
|
|||
"http://testserver.example.com:%s/%s%04d", port, path, i);
|
||||
|
||||
/* second request must succeed like the first one */
|
||||
res = do_one_request(multi, target_url, dns_entry);
|
||||
if(res != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "request %s failed with %d\n", target_url, res);
|
||||
result = do_one_request(multi, target_url, dns_entry);
|
||||
if(result != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "request %s failed with %d\n", target_url, result);
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -141,5 +141,5 @@ test_cleanup:
|
|||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static CURLcode test_lib1517(const char *URL)
|
|||
"this is what we post to the silly web server\n";
|
||||
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
struct t1517_WriteThis pooh;
|
||||
|
||||
|
|
@ -98,8 +98,8 @@ static CURLcode test_lib1517(const char *URL)
|
|||
/* detect HTTP error codes >= 400 */
|
||||
/* test_setopt(curl, CURLOPT_FAILONERROR, 1L); */
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Perform the request, result will get the return code */
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -107,5 +107,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static size_t t1518_write_cb(char *buffer, size_t size, size_t nitems,
|
|||
static CURLcode test_lib1518(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
long curlResponseCode;
|
||||
long curlRedirectCount;
|
||||
char *effectiveUrl = NULL;
|
||||
|
|
@ -68,9 +68,9 @@ static CURLcode test_lib1518(const char *URL)
|
|||
test_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
|
||||
}
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
/* Perform the request, result will get the return code */
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &curlResponseCode);
|
||||
|
|
@ -79,12 +79,12 @@ static CURLcode test_lib1518(const char *URL)
|
|||
curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &redirectUrl);
|
||||
test_setopt(curl, CURLOPT_WRITEFUNCTION, t1518_write_cb);
|
||||
|
||||
curl_mprintf("res %d\n"
|
||||
curl_mprintf("result %d\n"
|
||||
"status %ld\n"
|
||||
"redirects %ld\n"
|
||||
"effectiveurl %s\n"
|
||||
"redirecturl %s\n",
|
||||
res,
|
||||
result,
|
||||
curlResponseCode,
|
||||
curlRedirectCount,
|
||||
effectiveUrl,
|
||||
|
|
@ -96,5 +96,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
curl_url_cleanup(urlu);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ static size_t t1520_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
|
||||
static CURLcode test_lib1520(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
struct curl_slist *rcpt_list = NULL;
|
||||
struct upload_status upload_ctx = { 0 };
|
||||
|
|
@ -95,7 +95,7 @@ static CURLcode test_lib1520(const char *URL)
|
|||
test_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list);
|
||||
test_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -103,5 +103,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ static CURLcode test_lib1522(const char *URL)
|
|||
static char g_Data[40 * 1024]; /* POST 40KB */
|
||||
|
||||
CURLcode code = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
struct curl_slist *pHeaderList = NULL;
|
||||
CURL *curl = curl_easy_init();
|
||||
memset(g_Data, 'A', sizeof(g_Data)); /* send As! */
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static CURLcode run(CURL *curl, long limit, long time)
|
|||
|
||||
static CURLcode test_lib1523(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
char buffer[CURL_ERROR_SIZE];
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -64,18 +64,18 @@ static CURLcode test_lib1523(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, dload_progress_cb);
|
||||
|
||||
res = run(curl, 1, 2);
|
||||
if(res)
|
||||
curl_mfprintf(stderr, "error (%d) %s\n", res, buffer);
|
||||
result = run(curl, 1, 2);
|
||||
if(result)
|
||||
curl_mfprintf(stderr, "error (%d) %s\n", result, buffer);
|
||||
|
||||
res = run(curl, 12000, 1);
|
||||
if(res != CURLE_OPERATION_TIMEDOUT)
|
||||
curl_mfprintf(stderr, "error (%d) %s\n", res, buffer);
|
||||
result = run(curl, 12000, 1);
|
||||
if(result != CURLE_OPERATION_TIMEDOUT)
|
||||
curl_mfprintf(stderr, "error (%d) %s\n", result, buffer);
|
||||
else
|
||||
res = CURLE_OK;
|
||||
result = CURLE_OK;
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static size_t t1525_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
static CURLcode test_lib1525(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http and proxy header list */
|
||||
struct curl_slist *hhl = NULL;
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ static CURLcode test_lib1525(const char *URL)
|
|||
test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
|
||||
test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1525_testdata));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -93,5 +93,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static size_t t1526_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
static CURLcode test_lib1526(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http and proxy header list */
|
||||
struct curl_slist *hhl = NULL, *phl = NULL, *tmp = NULL;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ static CURLcode test_lib1526(const char *URL)
|
|||
test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
|
||||
test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1526_testdata));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -99,5 +99,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static size_t t1527_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
static CURLcode test_lib1527(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http header list */
|
||||
struct curl_slist *hhl = NULL, *tmp = NULL;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ static CURLcode test_lib1527(const char *URL)
|
|||
test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1527_testdata));
|
||||
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -95,5 +95,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1528(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http header list */
|
||||
struct curl_slist *hhl = NULL;
|
||||
struct curl_slist *phl = NULL;
|
||||
|
|
@ -59,7 +59,7 @@ static CURLcode test_lib1528(const char *URL)
|
|||
test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
|
||||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -68,5 +68,5 @@ test_cleanup:
|
|||
curl_slist_free_all(phl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1529(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
char bURL[512];
|
||||
curl_msnprintf(bURL, sizeof(bURL),
|
||||
"%s HTTP/1.1\r\nGET http://1529.com/1529", URL);
|
||||
|
|
@ -49,12 +49,12 @@ static CURLcode test_lib1529(const char *URL)
|
|||
test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
|
||||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static curl_socket_t opensocket(void *clientp,
|
|||
static CURLcode test_lib1530(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
(void)URL;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
|
|
@ -56,12 +56,12 @@ static CURLcode test_lib1530(const char *URL)
|
|||
test_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
test_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static CURLcode test_lib1531(const char *URL)
|
|||
int still_running; /* keep number of running handles */
|
||||
CURLMsg *msg; /* for picking up messages with the transfer status */
|
||||
int msgs_left; /* how many messages are left */
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
start_test_timing();
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ static CURLcode test_lib1531(const char *URL)
|
|||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
CURLMcode mc; /* curl_multi_fdset() return code */
|
||||
CURLMcode mresult; /* curl_multi_fdset() return code */
|
||||
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
|
|
@ -88,10 +88,10 @@ static CURLcode test_lib1531(const char *URL)
|
|||
}
|
||||
|
||||
/* get file descriptors from the transfers */
|
||||
mc = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
mresult = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
if(mc != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mfprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mresult);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -142,5 +142,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1532(const char *URL)
|
|||
{
|
||||
CURL *curl;
|
||||
long httpcode;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -37,36 +37,36 @@ static CURLcode test_lib1532(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_perform() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(httpcode != 200) {
|
||||
curl_mfprintf(stderr, "%s:%d unexpected response code %ld\n",
|
||||
__FILE__, __LINE__, httpcode);
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
result = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
/* Test for a regression of github bug 1017 (response code does not reset) */
|
||||
curl_easy_reset(curl);
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(httpcode) {
|
||||
|
|
@ -74,12 +74,12 @@ static CURLcode test_lib1532(const char *URL)
|
|||
"%s:%d curl_easy_reset failed to zero the response code\n"
|
||||
"possible regression of github bug 1017\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
result = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,17 +93,17 @@ static CURLcode perform_and_check_connections(CURL *curl,
|
|||
const char *description,
|
||||
long expected_connections)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
long connections = 0;
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_easy_perform() failed with %d\n", res);
|
||||
result = curl_easy_perform(curl);
|
||||
if(result != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_easy_perform() failed with %d\n", result);
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connections);
|
||||
if(res != CURLE_OK) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connections);
|
||||
if(result != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_easy_getinfo() failed\n");
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
|
@ -123,8 +123,7 @@ static CURLcode test_lib1533(const char *URL)
|
|||
{
|
||||
struct cb_data data;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = TEST_ERR_FAILURE;
|
||||
CURLcode result;
|
||||
CURLcode result = TEST_ERR_FAILURE;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_global_init() failed\n");
|
||||
|
|
@ -150,10 +149,11 @@ static CURLcode test_lib1533(const char *URL)
|
|||
test_setopt(curl, CURLOPT_WRITEFUNCTION, t1533_write_cb);
|
||||
test_setopt(curl, CURLOPT_WRITEDATA, &data);
|
||||
|
||||
result = perform_and_check_connections(curl,
|
||||
"First request without CURLOPT_KEEP_SENDING_ON_ERROR", 1);
|
||||
result =
|
||||
perform_and_check_connections(curl,
|
||||
"First request without "
|
||||
"CURLOPT_KEEP_SENDING_ON_ERROR", 1);
|
||||
if(result != TEST_ERR_SUCCESS) {
|
||||
res = result;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,6 @@ static CURLcode test_lib1533(const char *URL)
|
|||
result = perform_and_check_connections(curl,
|
||||
"Second request without CURLOPT_KEEP_SENDING_ON_ERROR", 1);
|
||||
if(result != TEST_ERR_SUCCESS) {
|
||||
res = result;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +172,6 @@ static CURLcode test_lib1533(const char *URL)
|
|||
result = perform_and_check_connections(curl,
|
||||
"First request with CURLOPT_KEEP_SENDING_ON_ERROR", 1);
|
||||
if(result != TEST_ERR_SUCCESS) {
|
||||
res = result;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -182,17 +180,14 @@ static CURLcode test_lib1533(const char *URL)
|
|||
result = perform_and_check_connections(curl,
|
||||
"Second request with CURLOPT_KEEP_SENDING_ON_ERROR", 0);
|
||||
if(result != TEST_ERR_SUCCESS) {
|
||||
res = result;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = TEST_ERR_SUCCESS;
|
||||
result = TEST_ERR_SUCCESS;
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1534(const char *URL)
|
|||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
long filetime;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -38,47 +38,47 @@ static CURLcode test_lib1534(const char *URL)
|
|||
/* Test that a filetime is properly initialized on curl_easy_init.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(filetime != -1) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d filetime init failed; expected -1 but is %ld\n",
|
||||
__FILE__, __LINE__, filetime);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_perform() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
/* Test that a filetime is properly set after receiving an HTTP resource.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(filetime != 30) {
|
||||
curl_mfprintf(stderr, "%s:%d filetime of http resource is incorrect; "
|
||||
"expected 30 but is %ld\n",
|
||||
__FILE__, __LINE__, filetime);
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
result = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -89,22 +89,22 @@ static CURLcode test_lib1534(const char *URL)
|
|||
if(!dupe) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(dupe, CURLINFO_FILETIME, &filetime);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(dupe, CURLINFO_FILETIME, &filetime);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(filetime != -1) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d filetime init failed; expected -1 but is %ld\n",
|
||||
__FILE__, __LINE__, filetime);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -113,18 +113,18 @@ static CURLcode test_lib1534(const char *URL)
|
|||
|
||||
curl_easy_reset(curl);
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(filetime != -1) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d filetime init failed; expected -1 but is %ld\n",
|
||||
__FILE__, __LINE__, filetime);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -132,5 +132,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1535(const char *URL)
|
|||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
long protocol;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -38,41 +38,41 @@ static CURLcode test_lib1535(const char *URL)
|
|||
/* Test that protocol is properly initialized on curl_easy_init.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
result = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
|
||||
if(res) {
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(protocol) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d protocol init failed; expected 0 but is %ld\n",
|
||||
__FILE__, __LINE__, protocol);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_perform() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
/* Test that a protocol is properly set after receiving an HTTP resource.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
result = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
|
||||
if(res) {
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(protocol != CURLPROTO_HTTP) {
|
||||
|
|
@ -80,7 +80,7 @@ static CURLcode test_lib1535(const char *URL)
|
|||
"%s:%d protocol of http resource is incorrect; "
|
||||
"expected %ld but is %ld\n",
|
||||
__FILE__, __LINE__, CURLPROTO_HTTP, protocol);
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
result = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -91,23 +91,23 @@ static CURLcode test_lib1535(const char *URL)
|
|||
if(!dupe) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(dupe, CURLINFO_PROTOCOL, &protocol);
|
||||
result = curl_easy_getinfo(dupe, CURLINFO_PROTOCOL, &protocol);
|
||||
|
||||
if(res) {
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(protocol) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d protocol init failed; expected 0 but is %ld\n",
|
||||
__FILE__, __LINE__, protocol);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -116,19 +116,19 @@ static CURLcode test_lib1535(const char *URL)
|
|||
|
||||
curl_easy_reset(curl);
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
result = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
|
||||
if(res) {
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(protocol) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d protocol init failed; expected 0 but is %ld\n",
|
||||
__FILE__, __LINE__, protocol);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -136,5 +136,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1536(const char *URL)
|
|||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
char *scheme;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -38,39 +38,39 @@ static CURLcode test_lib1536(const char *URL)
|
|||
/* Test that scheme is properly initialized on curl_easy_init.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(scheme) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d scheme init failed; expected NULL\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_perform() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
/* Test that a scheme is properly set after receiving an HTTP resource.
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(!scheme || memcmp(scheme, "http", 5) != 0) {
|
||||
|
|
@ -78,7 +78,7 @@ static CURLcode test_lib1536(const char *URL)
|
|||
"expected 'http' but is %s\n",
|
||||
__FILE__, __LINE__,
|
||||
(scheme == NULL ? "NULL" : "invalid"));
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
result = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -89,21 +89,21 @@ static CURLcode test_lib1536(const char *URL)
|
|||
if(!dupe) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(dupe, CURLINFO_SCHEME, &scheme);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(dupe, CURLINFO_SCHEME, &scheme);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(scheme) {
|
||||
curl_mfprintf(stderr, "%s:%d scheme init failed; expected NULL\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -112,17 +112,17 @@ static CURLcode test_lib1536(const char *URL)
|
|||
|
||||
curl_easy_reset(curl);
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d curl_easy_getinfo() failed with code %d (%s)\n",
|
||||
__FILE__, __LINE__, res, curl_easy_strerror(res));
|
||||
__FILE__, __LINE__, result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
if(scheme) {
|
||||
curl_mfprintf(stderr, "%s:%d scheme init failed; expected NULL\n",
|
||||
__FILE__, __LINE__);
|
||||
res = CURLE_FAILED_INIT;
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -130,5 +130,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ 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 };
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
char *ptr = NULL;
|
||||
int asize;
|
||||
int outlen = 0;
|
||||
|
|
@ -48,7 +48,7 @@ static CURLcode test_lib1537(const char *URL)
|
|||
/* deprecated API */
|
||||
ptr = curl_escape((const char *)a, asize);
|
||||
if(!ptr) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
curl_mprintf("%s\n", ptr);
|
||||
|
|
@ -62,7 +62,7 @@ static CURLcode test_lib1537(const char *URL)
|
|||
/* deprecated API */
|
||||
raw = curl_unescape(ptr, (int)strlen(ptr));
|
||||
if(!raw) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
outlen = (int)strlen(raw);
|
||||
|
|
@ -85,5 +85,5 @@ test_cleanup:
|
|||
curl_free(ptr);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
static CURLcode test_lib1538(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLcode easyret;
|
||||
CURLMcode multiret;
|
||||
CURLMcode mresult;
|
||||
CURLSHcode shareret;
|
||||
CURLUcode urlret;
|
||||
(void)URL;
|
||||
|
|
@ -45,9 +45,9 @@ static CURLcode test_lib1538(const char *URL)
|
|||
for(easyret = CURLE_OK; easyret <= CURL_LAST; easyret++) {
|
||||
curl_mprintf("e%d: %s\n", easyret, curl_easy_strerror(easyret));
|
||||
}
|
||||
for(multiret = CURLM_CALL_MULTI_PERFORM; multiret <= CURLM_LAST;
|
||||
multiret++) {
|
||||
curl_mprintf("m%d: %s\n", multiret, curl_multi_strerror(multiret));
|
||||
for(mresult = CURLM_CALL_MULTI_PERFORM; mresult <= CURLM_LAST;
|
||||
mresult++) {
|
||||
curl_mprintf("m%d: %s\n", mresult, curl_multi_strerror(mresult));
|
||||
}
|
||||
for(shareret = CURLSHE_OK; shareret <= CURLSHE_LAST; shareret++) {
|
||||
curl_mprintf("s%d: %s\n", shareret, curl_share_strerror(shareret));
|
||||
|
|
@ -56,5 +56,5 @@ static CURLcode test_lib1538(const char *URL)
|
|||
curl_mprintf("u%d: %s\n", urlret, curl_url_strerror(urlret));
|
||||
}
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ static size_t t1540_write_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
static CURLcode test_lib1540(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct t1540_transfer_status st;
|
||||
|
||||
start_test_timing();
|
||||
|
|
@ -111,12 +111,12 @@ static CURLcode test_lib1540(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res; /* return the final return code */
|
||||
return result; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ static void check_time(CURL *curl, int key, const char *name,
|
|||
const char *where)
|
||||
{
|
||||
curl_off_t tval;
|
||||
CURLcode res = curl_easy_getinfo(curl, (CURLINFO)key, &tval);
|
||||
if(res) {
|
||||
t1541_geterr(name, res, __LINE__);
|
||||
CURLcode result = curl_easy_getinfo(curl, (CURLINFO)key, &tval);
|
||||
if(result) {
|
||||
t1541_geterr(name, result, __LINE__);
|
||||
}
|
||||
else
|
||||
report_time(name, where, tval, tval > 0);
|
||||
|
|
@ -63,9 +63,9 @@ static void check_time0(CURL *curl, int key, const char *name,
|
|||
const char *where)
|
||||
{
|
||||
curl_off_t tval;
|
||||
CURLcode res = curl_easy_getinfo(curl, (CURLINFO)key, &tval);
|
||||
if(res) {
|
||||
t1541_geterr(name, res, __LINE__);
|
||||
CURLcode result = curl_easy_getinfo(curl, (CURLINFO)key, &tval);
|
||||
if(result) {
|
||||
t1541_geterr(name, result, __LINE__);
|
||||
}
|
||||
else
|
||||
report_time(name, where, tval, !tval);
|
||||
|
|
@ -107,7 +107,7 @@ static size_t t1541_write_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
static CURLcode test_lib1541(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct t1541_transfer_status st;
|
||||
|
||||
start_test_timing();
|
||||
|
|
@ -127,7 +127,7 @@ static CURLcode test_lib1541(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
check_time(curl, KN(CURLINFO_CONNECT_TIME_T), "done");
|
||||
check_time(curl, KN(CURLINFO_PRETRANSFER_TIME_T), "done");
|
||||
|
|
@ -143,5 +143,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res; /* return the final return code */
|
||||
return result; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
static CURLcode test_lib1542(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -51,26 +51,26 @@ static CURLcode test_lib1542(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
/* CURLOPT_MAXLIFETIME_CONN is inclusive - the connection needs to be 2
|
||||
* seconds old */
|
||||
curlx_wait_ms(2000);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
easy_setopt(curl, CURLOPT_MAXLIFETIME_CONN, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
test_cleanup:
|
||||
|
|
@ -78,5 +78,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1545(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct curl_httppost *lastptr = NULL;
|
||||
struct curl_httppost *m_formpost = NULL;
|
||||
|
||||
|
|
@ -48,5 +48,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
static CURLcode test_lib1549(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
|
|
@ -46,14 +46,14 @@ static CURLcode test_lib1549(const char *URL)
|
|||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
test_setopt(curl, CURLOPT_COOKIEFILE, "");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
if(!result) {
|
||||
/* extract all known cookies */
|
||||
struct curl_slist *cookies = NULL;
|
||||
int num = 0;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
|
||||
if(!res && cookies) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
|
||||
if(!result && cookies) {
|
||||
/* a linked list of cookies in cookie file format */
|
||||
struct curl_slist *each = cookies;
|
||||
while(each) {
|
||||
|
|
@ -71,5 +71,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
static CURLcode test_lib1550(const char *URL)
|
||||
{
|
||||
CURLM *multi;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
static const char * const bl_servers[] =
|
||||
{ "Microsoft-IIS/6.0", "nginx/0.8.54", NULL };
|
||||
static const char * const bl_sites[] =
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
static CURLcode test_lib1551(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
|
|
@ -36,16 +36,16 @@ static CURLcode test_lib1551(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_mfprintf(stderr, "****************************** Do it again\n");
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
}
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1552(const char *URL)
|
|||
CURLM *multi = NULL;
|
||||
int still_running;
|
||||
CURLcode i = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLMsg *msg;
|
||||
int counter = 3;
|
||||
|
||||
|
|
@ -53,12 +53,12 @@ static CURLcode test_lib1552(const char *URL)
|
|||
abort_on_test_timeout();
|
||||
|
||||
while(still_running && counter--) {
|
||||
CURLMcode mres;
|
||||
CURLMcode mresult;
|
||||
int num;
|
||||
mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mres != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mres);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
mresult = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mresult);
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -83,8 +83,8 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
if(res)
|
||||
i = res;
|
||||
if(result)
|
||||
i = result;
|
||||
|
||||
return i; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static CURLcode test_lib1553(const char *URL)
|
|||
CURLM *multi = NULL;
|
||||
int still_running;
|
||||
CURLcode i = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
curl_mimepart *field = NULL;
|
||||
curl_mime *mime = NULL;
|
||||
int counter = 1;
|
||||
|
|
@ -83,12 +83,12 @@ static CURLcode test_lib1553(const char *URL)
|
|||
abort_on_test_timeout();
|
||||
|
||||
while(still_running && counter--) {
|
||||
CURLMcode mres;
|
||||
CURLMcode mresult;
|
||||
int num;
|
||||
mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mres != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mres);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
mresult = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num);
|
||||
if(mresult != CURLM_OK) {
|
||||
curl_mprintf("curl_multi_wait() returned %d\n", mresult);
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
if(res)
|
||||
i = res;
|
||||
if(result)
|
||||
i = result;
|
||||
|
||||
return i; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static void t1554_test_unlock(CURL *curl, curl_lock_data data, void *useptr)
|
|||
/* test function */
|
||||
static CURLcode test_lib1554(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLSH *share = NULL;
|
||||
int i;
|
||||
|
||||
|
|
@ -83,16 +83,16 @@ static CURLcode test_lib1554(const char *URL)
|
|||
/* use the share object */
|
||||
curl_easy_setopt(curl, CURLOPT_SHARE, share);
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Perform the request, result will get the return code */
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
/* Check for errors */
|
||||
if(res != CURLE_OK) {
|
||||
if(result != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
}
|
||||
|
|
@ -102,5 +102,5 @@ test_cleanup:
|
|||
curl_share_cleanup(share);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static int progressCallback(void *arg,
|
|||
double ultotal,
|
||||
double ulnow)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
char buffer[256];
|
||||
size_t n = 0;
|
||||
(void)arg;
|
||||
|
|
@ -43,17 +43,17 @@ static int progressCallback(void *arg,
|
|||
(void)dlnow;
|
||||
(void)ultotal;
|
||||
(void)ulnow;
|
||||
res = curl_easy_recv(t1555_curl, buffer, 256, &n);
|
||||
curl_mprintf("curl_easy_recv returned %d\n", res);
|
||||
res = curl_easy_send(t1555_curl, buffer, n, &n);
|
||||
curl_mprintf("curl_easy_send returned %d\n", res);
|
||||
result = curl_easy_recv(t1555_curl, buffer, 256, &n);
|
||||
curl_mprintf("curl_easy_recv returned %d\n", result);
|
||||
result = curl_easy_send(t1555_curl, buffer, n, &n);
|
||||
curl_mprintf("curl_easy_send returned %d\n", result);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static CURLcode test_lib1555(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ static CURLcode test_lib1555(const char *URL)
|
|||
easy_setopt(t1555_curl, CURLOPT_PROGRESSDATA, NULL);
|
||||
easy_setopt(t1555_curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
||||
res = curl_easy_perform(t1555_curl);
|
||||
result = curl_easy_perform(t1555_curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -75,5 +75,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(t1555_curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static CURLcode test_lib1556(const char *URL)
|
|||
{
|
||||
CURLcode code;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct headerinfo info = { 0 };
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -61,7 +61,7 @@ static CURLcode test_lib1556(const char *URL)
|
|||
curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed, "
|
||||
"with code %d (%s)\n",
|
||||
__FILE__, __LINE__, code, curl_easy_strerror(code));
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -72,5 +72,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static CURLcode test_lib1557(const char *URL)
|
|||
CURL *curl1 = NULL;
|
||||
CURL *curl2 = NULL;
|
||||
int running_handles = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -56,5 +56,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl2);
|
||||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1558(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
long protocol = 0;
|
||||
|
||||
|
|
@ -33,17 +33,17 @@ static CURLcode test_lib1558(const char *URL)
|
|||
easy_init(curl);
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr, "curl_easy_perform() returned %d (%s)\n",
|
||||
res, curl_easy_strerror(res));
|
||||
result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
if(res) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
if(result) {
|
||||
curl_mfprintf(stderr, "curl_easy_getinfo() returned %d (%s)\n",
|
||||
res, curl_easy_strerror(res));
|
||||
result, curl_easy_strerror(result));
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -59,5 +59,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res; /* return the final return code */
|
||||
return result; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static CURLcode test_lib1559(const char *URL)
|
|||
{
|
||||
static const int EXCESSIVE = 10 * 1000 * 1000;
|
||||
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
char *longurl = NULL;
|
||||
CURLU *u;
|
||||
|
|
@ -38,20 +38,20 @@ static CURLcode test_lib1559(const char *URL)
|
|||
|
||||
longurl = curlx_malloc(EXCESSIVE);
|
||||
if(!longurl) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
memset(longurl, 'a', EXCESSIVE);
|
||||
longurl[EXCESSIVE - 1] = 0;
|
||||
|
||||
res = curl_easy_setopt(curl, CURLOPT_URL, longurl);
|
||||
result = curl_easy_setopt(curl, CURLOPT_URL, longurl);
|
||||
curl_mprintf("CURLOPT_URL %d bytes URL == %d\n",
|
||||
EXCESSIVE, res);
|
||||
EXCESSIVE, result);
|
||||
|
||||
res = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, longurl);
|
||||
result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, longurl);
|
||||
curl_mprintf("CURLOPT_POSTFIELDS %d bytes data == %d\n",
|
||||
EXCESSIVE, res);
|
||||
EXCESSIVE, result);
|
||||
|
||||
u = curl_url();
|
||||
if(u) {
|
||||
|
|
@ -72,5 +72,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res; /* return the final return code */
|
||||
return result; /* return the final return code */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
CURLM *multi = NULL;
|
||||
int numfds;
|
||||
int i;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct curltime time_before_wait, time_after_wait;
|
||||
|
||||
(void)URL;
|
||||
|
|
@ -50,7 +50,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n",
|
||||
__FILE__, __LINE__);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
if(curlx_timediff_ms(time_after_wait, time_before_wait) > 500) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n",
|
||||
__FILE__, __LINE__);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n",
|
||||
__FILE__, __LINE__);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
if(curlx_timediff_ms(time_after_wait, time_before_wait) > 500) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n",
|
||||
__FILE__, __LINE__);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ static CURLcode test_lib1564(const char *URL)
|
|||
if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) {
|
||||
curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n",
|
||||
__FILE__, __LINE__);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -126,5 +126,5 @@ test_cleanup:
|
|||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ static const char *t1565_url;
|
|||
static void *t1565_run_thread(void *ptr)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
int i;
|
||||
|
||||
(void)ptr;
|
||||
|
|
@ -76,7 +76,7 @@ test_cleanup:
|
|||
pthread_mutex_lock(&lock);
|
||||
|
||||
if(!t1565_test_failure)
|
||||
t1565_test_failure = res;
|
||||
t1565_test_failure = result;
|
||||
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
|
|
@ -88,8 +88,8 @@ static CURLcode test_lib1565(const char *URL)
|
|||
int still_running;
|
||||
int num;
|
||||
int i;
|
||||
int result;
|
||||
CURLcode res = CURLE_OK;
|
||||
int rc;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *started_curls[CONN_NUM];
|
||||
int started_num = 0;
|
||||
int finished_num = 0;
|
||||
|
|
@ -105,12 +105,13 @@ static CURLcode test_lib1565(const char *URL)
|
|||
|
||||
t1565_url = URL;
|
||||
|
||||
result = pthread_create(&tid, NULL, t1565_run_thread, NULL);
|
||||
if(!result)
|
||||
rc = pthread_create(&tid, NULL, t1565_run_thread, NULL);
|
||||
if(!rc)
|
||||
tid_valid = true;
|
||||
else {
|
||||
curl_mfprintf(stderr, "%s:%d Could not create thread, errno %d\n",
|
||||
__FILE__, __LINE__, result);
|
||||
__FILE__, __LINE__, rc);
|
||||
result = CURLE_FAILED_INIT;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -121,8 +122,8 @@ static CURLcode test_lib1565(const char *URL)
|
|||
|
||||
while((message = curl_multi_info_read(testmulti, &num))) {
|
||||
if(message->msg == CURLMSG_DONE) {
|
||||
res = message->data.result;
|
||||
if(res)
|
||||
result = message->data.result;
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
multi_remove_handle(testmulti, message->easy_handle);
|
||||
finished_num++;
|
||||
|
|
@ -131,7 +132,7 @@ static CURLcode test_lib1565(const char *URL)
|
|||
curl_mfprintf(stderr,
|
||||
"%s:%d Got an unexpected message from curl: %i\n",
|
||||
__FILE__, __LINE__, message->msg);
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ static CURLcode test_lib1565(const char *URL)
|
|||
|
||||
while(pending_num > 0) {
|
||||
res_multi_add_handle(testmulti, pending_curls[pending_num - 1]);
|
||||
if(res) {
|
||||
if(result) {
|
||||
pthread_mutex_unlock(&lock);
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -180,7 +181,7 @@ test_cleanup:
|
|||
|
||||
pthread_mutex_lock(&lock);
|
||||
if(!t1565_test_failure)
|
||||
t1565_test_failure = res;
|
||||
t1565_test_failure = result;
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
if(tid_valid)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
static CURLcode test_lib1567(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLU *u = NULL;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -40,12 +40,12 @@ static CURLcode test_lib1567(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_url_set(u, CURLUPART_URL, URL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_CURLU, u);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_mfprintf(stderr, "****************************** Do it again\n");
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -53,5 +53,5 @@ test_cleanup:
|
|||
curl_url_cleanup(u);
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@
|
|||
|
||||
static CURLcode test_lib1568(const char *URL)
|
||||
{
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
CURL *curl;
|
||||
curl_off_t port;
|
||||
|
||||
if(curlx_str_number(&libtest_arg2, &port, 0xffff))
|
||||
return res;
|
||||
return result;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK)
|
||||
return res;
|
||||
return result;
|
||||
|
||||
curl = curl_easy_init();
|
||||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
|
@ -45,10 +45,10 @@ static CURLcode test_lib1568(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(curl, CURLOPT_PORT, (long)port);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1569(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -34,15 +34,15 @@ static CURLcode test_lib1569(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, libtest_arg2);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1571(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
|
|
@ -59,12 +59,12 @@ static CURLcode test_lib1571(const char *URL)
|
|||
test_setopt(curl, CURLOPT_FOLLOWLOCATION, CURLFOLLOW_OBEYCODE);
|
||||
}
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ static int t1576_seek_callback(void *ptr, curl_off_t offset, int origin)
|
|||
|
||||
static CURLcode test_lib1576(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
struct curl_slist *pHeaderList = NULL;
|
||||
|
||||
|
|
@ -82,12 +82,12 @@ static CURLcode test_lib1576(const char *URL)
|
|||
pHeaderList = curl_slist_append(pHeaderList, "Expect:");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, pHeaderList);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
curl_slist_free_all(pHeaderList);
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1582(const char *URL)
|
||||
{
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
CURL *curl;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
|
|
@ -48,11 +48,11 @@ static CURLcode test_lib1582(const char *URL)
|
|||
test_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
test_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ static int t1591_trailers_callback(struct curl_slist **list, void *userdata)
|
|||
static CURLcode test_lib1591(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http and proxy header list */
|
||||
struct curl_slist *hhl = NULL;
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ static CURLcode test_lib1591(const char *URL)
|
|||
test_setopt(curl, CURLOPT_TRAILERFUNCTION, t1591_trailers_callback);
|
||||
test_setopt(curl, CURLOPT_TRAILERDATA, NULL);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -114,5 +114,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ static CURLcode test_lib1592(const char *URL)
|
|||
int stillRunning;
|
||||
CURLM *multi = NULL;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLMcode mres;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURLMcode mresult;
|
||||
long timeout;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -98,11 +98,11 @@ static CURLcode test_lib1592(const char *URL)
|
|||
/* Start measuring how long it takes to remove the handle. */
|
||||
curl_mfprintf(stderr, "curl_multi_remove_handle()...\n");
|
||||
start_test_timing();
|
||||
mres = curl_multi_remove_handle(multi, curl);
|
||||
if(mres) {
|
||||
curl_mfprintf(stderr,
|
||||
"curl_multi_remove_handle() failed, with code %d\n", mres);
|
||||
res = TEST_ERR_MULTI;
|
||||
mresult = curl_multi_remove_handle(multi, curl);
|
||||
if(mresult) {
|
||||
curl_mfprintf(stderr, "curl_multi_remove_handle() failed, with code %d\n",
|
||||
mresult);
|
||||
result = TEST_ERR_MULTI;
|
||||
goto test_cleanup;
|
||||
}
|
||||
curl_mfprintf(stderr, "curl_multi_remove_handle() succeeded\n");
|
||||
|
|
@ -117,5 +117,5 @@ test_cleanup:
|
|||
curl_multi_cleanup(multi);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ static CURLcode test_lib1593(const char *URL)
|
|||
struct curl_slist *header = NULL;
|
||||
long unmet;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -44,14 +44,14 @@ static CURLcode test_lib1593(const char *URL)
|
|||
|
||||
header = curl_slist_append(NULL, "If-Modified-Since:");
|
||||
if(!header) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
result = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
easy_setopt(curl, CURLOPT_HTTPHEADER, header);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
/* Confirm that the condition checking still worked, even though we
|
||||
|
|
@ -59,12 +59,12 @@ static CURLcode test_lib1593(const char *URL)
|
|||
* The server returns 304, which means the condition is "unmet".
|
||||
*/
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(res)
|
||||
result = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
if(unmet != 1L) {
|
||||
res = TEST_ERR_FAILURE;
|
||||
result = TEST_ERR_FAILURE;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -75,5 +75,5 @@ test_cleanup:
|
|||
curl_slist_free_all(header);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ static CURLcode test_lib1594(const char *URL)
|
|||
struct curl_slist *header = NULL;
|
||||
curl_off_t retry;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -39,12 +39,12 @@ static CURLcode test_lib1594(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry);
|
||||
if(res)
|
||||
result = curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_mprintf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry);
|
||||
|
|
@ -56,5 +56,5 @@ test_cleanup:
|
|||
curl_slist_free_all(header);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct pair {
|
|||
static CURLcode test_lib1597(const char *URL)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
curl_version_info_data *curlinfo;
|
||||
const char * const *proto;
|
||||
int n;
|
||||
|
|
@ -74,7 +74,7 @@ static CURLcode test_lib1597(const char *URL)
|
|||
curlinfo = curl_version_info(CURLVERSION_NOW);
|
||||
if(!curlinfo) {
|
||||
fputs("curl_version_info failed\n", stderr);
|
||||
res = TEST_ERR_FAILURE;
|
||||
result = TEST_ERR_FAILURE;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ static CURLcode test_lib1597(const char *URL)
|
|||
for(proto = curlinfo->protocols; *proto; proto++) {
|
||||
if((size_t)n >= sizeof(protolist)) {
|
||||
puts("protolist buffer too small\n");
|
||||
res = TEST_ERR_FAILURE;
|
||||
result = TEST_ERR_FAILURE;
|
||||
goto test_cleanup;
|
||||
}
|
||||
n += curl_msnprintf(protolist + n, sizeof(protolist) - n, ",%s", *proto);
|
||||
|
|
@ -94,9 +94,9 @@ static CURLcode test_lib1597(const char *URL)
|
|||
|
||||
/* Run the tests. */
|
||||
for(i = 0; prots[i].in; i++) {
|
||||
res = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, prots[i].in);
|
||||
if(res != *prots[i].exp) {
|
||||
curl_mprintf("unexpectedly '%s' returned %d\n", prots[i].in, res);
|
||||
result = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, prots[i].in);
|
||||
if(result != *prots[i].exp) {
|
||||
curl_mprintf("unexpectedly '%s' returned %d\n", prots[i].in, result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -106,5 +106,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static CURLcode test_lib1598(const char *URL)
|
|||
static const char *post_data = "xxx=yyy&aaa=bbbbb";
|
||||
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
CURLcode result = CURLE_FAILED_INIT;
|
||||
/* http and proxy header list */
|
||||
struct curl_slist *hhl = NULL, *list;
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ static CURLcode test_lib1598(const char *URL)
|
|||
test_setopt(curl, CURLOPT_TRAILERDATA, NULL);
|
||||
test_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -100,5 +100,5 @@ test_cleanup:
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1599(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
|
|
@ -36,9 +36,9 @@ static CURLcode test_lib1599(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static size_t t1662_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
|
||||
static CURLcode test_lib1662(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl;
|
||||
curl_mime *mime1;
|
||||
curl_mimepart *part1;
|
||||
|
|
@ -77,12 +77,12 @@ static CURLcode test_lib1662(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
}
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_mime_free(mime1);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1900(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl1 = NULL;
|
||||
CURL *curl2 = NULL;
|
||||
|
||||
|
|
@ -47,5 +47,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl1);
|
||||
curl_easy_cleanup(curl2);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static size_t t1901_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
static CURLcode test_lib1901(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct curl_slist *chunk = NULL;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -76,12 +76,12 @@ static CURLcode test_lib1901(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_HTTPHEADER, n);
|
||||
}
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
}
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_slist_free_all(chunk);
|
||||
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1902(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
|
@ -42,5 +42,5 @@ static CURLcode test_lib1902(const char *URL)
|
|||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1903(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
|
@ -33,8 +33,8 @@ static CURLcode test_lib1903(const char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
|
||||
curl_easy_reset(curl);
|
||||
|
|
@ -42,11 +42,11 @@ static CURLcode test_lib1903(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2);
|
||||
easy_setopt(curl, CURLOPT_COOKIEJAR, libtest_arg3);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1906(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
char *url_after = NULL;
|
||||
CURLU *curlu = curl_url();
|
||||
char error_buffer[CURL_ERROR_SIZE] = "";
|
||||
|
|
@ -41,16 +41,16 @@ static CURLcode test_lib1906(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 5000L);
|
||||
/* set a port number that makes this request fail */
|
||||
easy_setopt(curl, CURLOPT_PORT, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_COULDNT_CONNECT && res != CURLE_OPERATION_TIMEDOUT) {
|
||||
result = curl_easy_perform(curl);
|
||||
if(result != CURLE_COULDNT_CONNECT && result != CURLE_OPERATION_TIMEDOUT) {
|
||||
curl_mfprintf(stderr, "failure expected, "
|
||||
"curl_easy_perform returned %d: <%s>, <%s>\n",
|
||||
res, curl_easy_strerror(res), error_buffer);
|
||||
if(res == CURLE_OK)
|
||||
res = TEST_ERR_MAJOR_BAD; /* force an error return */
|
||||
result, curl_easy_strerror(result), error_buffer);
|
||||
if(result == CURLE_OK)
|
||||
result = TEST_ERR_MAJOR_BAD; /* force an error return */
|
||||
goto test_cleanup;
|
||||
}
|
||||
res = CURLE_OK; /* reset for next use */
|
||||
result = CURLE_OK; /* reset for next use */
|
||||
|
||||
/* print the used URL */
|
||||
curl_url_get(curlu, CURLUPART_URL, &url_after, 0);
|
||||
|
|
@ -61,11 +61,11 @@ static CURLcode test_lib1906(const char *URL)
|
|||
/* now reset CURLOP_PORT to go back to originally set port number */
|
||||
easy_setopt(curl, CURLOPT_PORT, 0L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
curl_mfprintf(stderr, "success expected, "
|
||||
"curl_easy_perform returned %d: <%s>, <%s>\n",
|
||||
res, curl_easy_strerror(res), error_buffer);
|
||||
result, curl_easy_strerror(result), error_buffer);
|
||||
|
||||
/* print URL */
|
||||
curl_url_get(curlu, CURLUPART_URL, &url_after, 0);
|
||||
|
|
@ -77,5 +77,5 @@ test_cleanup:
|
|||
curl_url_cleanup(curlu);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static CURLcode test_lib1907(const char *URL)
|
|||
{
|
||||
char *url_after;
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
char error_buffer[CURL_ERROR_SIZE] = "";
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
|
@ -35,11 +35,11 @@ static CURLcode test_lib1907(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(!res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(!result)
|
||||
curl_mfprintf(stderr, "failure expected, "
|
||||
"curl_easy_perform returned %d: <%s>, <%s>\n",
|
||||
res, curl_easy_strerror(res), error_buffer);
|
||||
result, curl_easy_strerror(result), error_buffer);
|
||||
|
||||
/* print the used URL */
|
||||
if(!curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url_after))
|
||||
|
|
@ -48,5 +48,5 @@ static CURLcode test_lib1907(const char *URL)
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1908(const char *URL)
|
||||
{
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
CURL *curl;
|
||||
start_test_timing();
|
||||
|
||||
|
|
@ -36,13 +36,13 @@ static CURLcode test_lib1908(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_ALTSVC, libtest_arg2);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
if(!result) {
|
||||
/* make a copy and check that this also has alt-svc activated */
|
||||
CURL *curldupe = curl_easy_duphandle(curl);
|
||||
if(curldupe) {
|
||||
res = curl_easy_perform(curldupe);
|
||||
result = curl_easy_perform(curldupe);
|
||||
/* we close the second handle first, which makes it store the alt-svc
|
||||
file only to get overwritten when the next handle is closed! */
|
||||
curl_easy_cleanup(curldupe);
|
||||
|
|
@ -56,5 +56,5 @@ static CURLcode test_lib1908(const char *URL)
|
|||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1910(const char *URL)
|
||||
{
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
CURL *curl;
|
||||
start_test_timing();
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ static CURLcode test_lib1910(const char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_USERPWD, "user\nname:pass\nword");
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static CURLcode test_lib1911(const char *URL)
|
|||
|
||||
for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) {
|
||||
if(o->type == CURLOT_STRING) {
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
/*
|
||||
* Whitelist string options that are safe for abuse
|
||||
*/
|
||||
|
|
@ -68,8 +68,8 @@ static CURLcode test_lib1911(const char *URL)
|
|||
|
||||
/* This is a string. Make sure that passing in a string longer
|
||||
CURL_MAX_INPUT_LENGTH returns an error */
|
||||
res = curl_easy_setopt(curl, o->id, testbuf);
|
||||
switch(res) {
|
||||
result = curl_easy_setopt(curl, o->id, testbuf);
|
||||
switch(result) {
|
||||
case CURLE_BAD_FUNCTION_ARGUMENT: /* the most normal */
|
||||
case CURLE_UNKNOWN_OPTION: /* left out from the build */
|
||||
case CURLE_NOT_BUILT_IN: /* not supported */
|
||||
|
|
@ -78,7 +78,7 @@ static CURLcode test_lib1911(const char *URL)
|
|||
default:
|
||||
/* all other return codes are unexpected */
|
||||
curl_mfprintf(stderr, "curl_easy_setopt(%s...) returned %d\n",
|
||||
o->name, res);
|
||||
o->name, result);
|
||||
error++;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1913(const char *URL)
|
||||
{
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
CURL *curl;
|
||||
start_test_timing();
|
||||
|
||||
|
|
@ -38,9 +38,9 @@ static CURLcode test_lib1913(const char *URL)
|
|||
if(libtest_arg2)
|
||||
/* test1914 sets this extra arg */
|
||||
curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ static CURLSTScode hstswrite(CURL *curl, struct curl_hstsentry *e,
|
|||
|
||||
static CURLcode test_lib1915(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl;
|
||||
struct state st = { 0 };
|
||||
|
||||
|
|
@ -115,13 +115,13 @@ static CURLcode test_lib1915(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config);
|
||||
easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
curl = NULL;
|
||||
if(res == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */
|
||||
res = CURLE_COULDNT_CONNECT;
|
||||
curl_mprintf("First request returned %d\n", res);
|
||||
res = CURLE_OK;
|
||||
if(result == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
curl_mprintf("First request returned %d\n", result);
|
||||
result = CURLE_OK;
|
||||
|
||||
easy_init(curl);
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
|
@ -134,13 +134,13 @@ static CURLcode test_lib1915(const char *URL)
|
|||
easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config);
|
||||
easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
curl = NULL;
|
||||
curl_mprintf("Second request returned %d\n", res);
|
||||
curl_mprintf("Second request returned %d\n", result);
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1916(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
curl_mfprintf(stderr, "curl_global_init() failed\n");
|
||||
|
|
@ -43,12 +43,12 @@ static CURLcode test_lib1916(const char *URL)
|
|||
else {
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "");
|
||||
}
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
curl_mprintf("res: %d\n", res);
|
||||
result = curl_easy_perform(curl);
|
||||
if(result) {
|
||||
curl_mprintf("result: %d\n", result);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
static CURLcode test_lib1919(const char *URL)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
CURL *curl;
|
||||
int i;
|
||||
|
||||
|
|
@ -40,13 +40,13 @@ static CURLcode test_lib1919(const char *URL)
|
|||
|
||||
for(i = 0; i < 2; i++) {
|
||||
/* the second request needs to do connection reuse */
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
result = curl_easy_perform(curl);
|
||||
if(result)
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1933(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ static CURLcode test_lib1933(const char *URL)
|
|||
list = curl_slist_append(list, "Content-Type: application/json");
|
||||
test_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -62,5 +62,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1934(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ static CURLcode test_lib1934(const char *URL)
|
|||
list = curl_slist_append(list, "Content-Type: application/json");
|
||||
test_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -63,5 +63,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1935(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ static CURLcode test_lib1935(const char *URL)
|
|||
list = curl_slist_append(list, "Content-Type: application/json");
|
||||
test_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -63,5 +63,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1936(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ static CURLcode test_lib1936(const char *URL)
|
|||
list = curl_slist_append(list, "Content-Type: application/json");
|
||||
test_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -63,5 +63,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1937(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = TEST_ERR_MAJOR_BAD;
|
||||
struct curl_slist *connect_to = NULL;
|
||||
struct curl_slist *list = NULL;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ static CURLcode test_lib1937(const char *URL)
|
|||
test_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||
test_setopt(curl, CURLOPT_POSTFIELDS, "postData");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -65,5 +65,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
static CURLcode test_lib1938(const char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = TEST_ERR_MAJOR_BAD;
|
||||
CURLcode result = 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 };
|
||||
|
|
@ -58,7 +58,7 @@ static CURLcode test_lib1938(const char *URL)
|
|||
test_setopt(curl, CURLOPT_POSTFIELDS, data);
|
||||
test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)sizeof(data));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
test_cleanup:
|
||||
|
||||
|
|
@ -67,5 +67,5 @@ test_cleanup:
|
|||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ static CURLcode test_lib1939(const char *URL)
|
|||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode c;
|
||||
CURLMcode m;
|
||||
CURLMcode mresult;
|
||||
|
||||
/* Crash only happens when using HTTPS */
|
||||
c = curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
|
|
@ -48,14 +48,14 @@ static CURLcode test_lib1939(const char *URL)
|
|||
|
||||
/* We are going to drive the transfer using multi interface here,
|
||||
because we want to stop during the middle. */
|
||||
m = curl_multi_add_handle(multi, curl);
|
||||
mresult = curl_multi_add_handle(multi, curl);
|
||||
|
||||
if(!m)
|
||||
if(!mresult)
|
||||
/* Run the multi handle once, just enough to start establishing an
|
||||
HTTPS connection. */
|
||||
m = curl_multi_perform(multi, &running_handles);
|
||||
mresult = curl_multi_perform(multi, &running_handles);
|
||||
|
||||
if(m)
|
||||
if(mresult)
|
||||
curl_mfprintf(stderr, "curl_multi_perform failed\n");
|
||||
}
|
||||
/* Close the easy handle *before* the multi handle. Doing it the other
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue