mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
parent
0bb842a587
commit
6fa89fa893
@ -77,7 +77,7 @@ int test(char *URL)
|
||||
if(ret != CURLE_OPERATION_TIMEDOUT)
|
||||
fprintf(stderr, "error %d: %s\n", ret, buffer);
|
||||
else
|
||||
ret = 0;
|
||||
ret = CURLE_OK;
|
||||
|
||||
printf("End: %d\n", time(NULL));
|
||||
curl_easy_cleanup(hnd);
|
||||
|
||||
@ -31,7 +31,7 @@ int test(char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
long httpcode;
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@ -78,5 +78,5 @@ int test(char *URL)
|
||||
test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return (int)res;
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ int test(char *URL)
|
||||
{
|
||||
struct cb_data data;
|
||||
CURL *curl = NULL;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
int res = TEST_ERR_FAILURE;
|
||||
|
||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||
fprintf(stderr, "curl_global_init() failed\n");
|
||||
|
||||
@ -31,7 +31,7 @@ int test(char *URL)
|
||||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
long filetime;
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@ -127,5 +127,5 @@ test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return (int)res;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ int test(char *URL)
|
||||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
long protocol;
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@ -126,5 +126,5 @@ test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return (int)res;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ int test(char *URL)
|
||||
{
|
||||
CURL *curl, *dupe = NULL;
|
||||
char *scheme;
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@ -127,5 +127,5 @@ test_cleanup:
|
||||
curl_easy_cleanup(curl);
|
||||
curl_easy_cleanup(dupe);
|
||||
curl_global_cleanup();
|
||||
return res;
|
||||
return (int)res;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ static int progressCallback(void *arg,
|
||||
double ultotal,
|
||||
double ulnow)
|
||||
{
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
char buffer[256];
|
||||
size_t n = 0;
|
||||
(void)arg;
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
int test(char *URL)
|
||||
{
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
long protocol = 0;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#define EXCESSIVE 10*1000*1000
|
||||
int test(char *URL)
|
||||
{
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURL *curl = NULL;
|
||||
char *longurl = malloc(EXCESSIVE);
|
||||
CURLU *u;
|
||||
|
||||
@ -60,7 +60,7 @@ static int checkparts(CURLU *u, const char *in, const char *wanted,
|
||||
{CURLUPART_PATH, "path"},
|
||||
{CURLUPART_QUERY, "query"},
|
||||
{CURLUPART_FRAGMENT, "fragment"},
|
||||
{0, NULL}
|
||||
{CURLUPART_URL, NULL}
|
||||
};
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
@ -558,7 +558,7 @@ static const struct urltestcase get_url_list[] = {
|
||||
{"custom-scheme://host?expected=test-still-good",
|
||||
"custom-scheme://host/?expected=test-still-good",
|
||||
CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY, 0, CURLUE_OK},
|
||||
{NULL, NULL, 0, 0, 0}
|
||||
{NULL, NULL, 0, 0, CURLUE_OK}
|
||||
};
|
||||
|
||||
static int checkurl(const char *url, const char *out)
|
||||
@ -722,7 +722,7 @@ static const struct setcase set_parts_list[] = {
|
||||
CURLU_NON_SUPPORT_SCHEME, CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY,
|
||||
CURLUE_OK, CURLUE_OK},
|
||||
|
||||
{NULL, NULL, NULL, 0, 0, 0, 0}
|
||||
{NULL, NULL, NULL, 0, 0, CURLUE_OK, CURLUE_OK}
|
||||
};
|
||||
|
||||
static CURLUPart part2id(char *part)
|
||||
@ -800,32 +800,32 @@ static const struct redircase set_url_list[] = {
|
||||
{"http://example.org/static/favicon/wikipedia.ico",
|
||||
"//fake.example.com/licenses/by-sa/3.0/",
|
||||
"http://fake.example.com/licenses/by-sa/3.0/",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"https://example.org/static/favicon/wikipedia.ico",
|
||||
"//fake.example.com/licenses/by-sa/3.0/",
|
||||
"https://fake.example.com/licenses/by-sa/3.0/",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"file://localhost/path?query#frag",
|
||||
"foo#another",
|
||||
"file:///foo#another",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"http://example.com/path?query#frag",
|
||||
"https://two.example.com/bradnew",
|
||||
"https://two.example.com/bradnew",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"http://example.com/path?query#frag",
|
||||
"../../newpage#foo",
|
||||
"http://example.com/newpage#foo",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"http://user:foo@example.com/path?query#frag",
|
||||
"../../newpage",
|
||||
"http://user:foo@example.com/newpage",
|
||||
0, 0, 0},
|
||||
0, 0, CURLUE_OK},
|
||||
{"http://user:foo@example.com/path?query#frag",
|
||||
"../newpage",
|
||||
"http://user:foo@example.com/newpage",
|
||||
0, 0, 0},
|
||||
{NULL, NULL, NULL, 0, 0, 0}
|
||||
0, 0, CURLUE_OK},
|
||||
{NULL, NULL, NULL, 0, 0, CURLUE_OK}
|
||||
};
|
||||
|
||||
static int set_url(void)
|
||||
@ -1012,7 +1012,7 @@ static const struct querycase append_list[] = {
|
||||
0, 0, CURLUE_OK},
|
||||
{"HTTP://test/?size=2#f", "name=joe", "http://test/?size=2&name=joe#f",
|
||||
0, 0, CURLUE_OK},
|
||||
{NULL, NULL, NULL, 0, 0, 0}
|
||||
{NULL, NULL, NULL, 0, 0, CURLUE_OK}
|
||||
};
|
||||
|
||||
static int append(void)
|
||||
@ -1253,7 +1253,7 @@ static const struct clearurlcase clear_url_list[] ={
|
||||
{CURLUPART_PATH, "/hello", "/", CURLUE_OK},
|
||||
{CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY},
|
||||
{CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT},
|
||||
{0, NULL, NULL, CURLUE_OK},
|
||||
{CURLUPART_URL, NULL, NULL, CURLUE_OK},
|
||||
};
|
||||
|
||||
static int clear_url(void)
|
||||
|
||||
@ -58,7 +58,7 @@ int test(char *URL)
|
||||
"POP3,POP3S,RTMP,RTMPE,RTMPS,RTMPT,RTMPTE,RTMPTS,RTSP,SCP,SFTP,SMB,"
|
||||
"SMBS,SMTP,SMTPS,TELNET,TFTP", CURLE_OK},
|
||||
{"all", CURLE_OK},
|
||||
{NULL, FALSE},
|
||||
{NULL, CURLE_OK},
|
||||
};
|
||||
(void)URL;
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ static int checkFdSet(CURLM *curl,
|
||||
int evBitmask, const char *name)
|
||||
{
|
||||
int i;
|
||||
CURLMcode result = CURLM_OK;
|
||||
int result = 0;
|
||||
for(i = 0; i < sockets->count; ++i) {
|
||||
if(FD_ISSET(sockets->sockets[i], fdset)) {
|
||||
result = socket_action(curl, sockets->sockets[i], evBitmask, name);
|
||||
@ -257,7 +257,7 @@ static int checkFdSet(CURLM *curl,
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (int)result;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int testone(char *URL, int timercb, int socketcb)
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
int test(char *URL)
|
||||
{
|
||||
CURL *handle = NULL;
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLU *urlp = NULL;
|
||||
CURLUcode uc = 0;
|
||||
CURLUcode uc = CURLUE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
easy_init(handle);
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
int test(char *URL)
|
||||
{
|
||||
CURL *handle = NULL;
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLU *urlp = NULL;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@ -35,9 +35,9 @@ int test(char *URL)
|
||||
{
|
||||
CURL *handle = NULL;
|
||||
CURL *handle2;
|
||||
CURLcode res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLU *urlp = NULL;
|
||||
CURLUcode uc = 0;
|
||||
CURLUcode uc = CURLUE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
easy_init(handle);
|
||||
|
||||
@ -32,7 +32,7 @@ static struct Curl_easy *data;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
data = curl_easy_init();
|
||||
|
||||
@ -31,7 +31,7 @@ static struct Curl_easy *data;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
data = curl_easy_init();
|
||||
|
||||
@ -27,7 +27,7 @@ static CURL *hnd;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
|
||||
@ -30,7 +30,7 @@ static CURL *easy;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
easy = curl_easy_init();
|
||||
|
||||
@ -29,7 +29,7 @@ static CURL *easy;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
easy = curl_easy_init();
|
||||
|
||||
@ -30,7 +30,7 @@ static CURL *easy;
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
easy = curl_easy_init();
|
||||
|
||||
@ -36,7 +36,7 @@ static void unit_stop(void)
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ static void unit_stop(void)
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
int res = CURLE_OK;
|
||||
CURLcode res = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ debugf_cb(CURL *handle, curl_infotype type, char *buf, size_t size,
|
||||
static CURLcode
|
||||
unit_setup(void)
|
||||
{
|
||||
int res = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
data = curl_easy_init();
|
||||
@ -71,7 +71,7 @@ unit_setup(void)
|
||||
}
|
||||
curl_easy_setopt(data, CURLOPT_DEBUGFUNCTION, debugf_cb);
|
||||
curl_easy_setopt(data, CURLOPT_VERBOSE, 1L);
|
||||
return CURLE_OK;
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@ -103,7 +103,7 @@ static const struct testit headers[] = {
|
||||
|
||||
/* make this live for 7 seconds */
|
||||
{ "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK },
|
||||
{ NULL, NULL, NULL, 0 }
|
||||
{ NULL, NULL, NULL, CURLE_OK }
|
||||
};
|
||||
|
||||
static void showsts(struct stsentry *e, const char *chost)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user