libtests: stop checking for CURLM_CALL_MULTI_PERFORM

CURLM_CALL_MULTI_PERFORM stopped being a valid return code from
curl_multi_perform back in 7.20.0. All the libcurl tests are ajusted to
this and no longer check for this return code. Makes them simpler.
This commit is contained in:
Daniel Stenberg 2011-06-26 23:12:08 +02:00
Родитель 78480892cd
Коммит fb48e2050b
13 изменённых файлов: 118 добавлений и 165 удалений

Просмотреть файл

@ -103,7 +103,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -114,7 +113,7 @@ int test(char *URL)
done = TRUE;
break;
}
}
if (mp_timedout || done)
break;
@ -140,7 +139,6 @@ int test(char *URL)
break;
}
res = CURLM_CALL_MULTI_PERFORM;
}
if (ml_timedout || mp_timedout) {

Просмотреть файл

@ -106,16 +106,12 @@ int test(char *URL)
fprintf(stderr, "curl_multi_perform()\n");
ret = CURLM_CALL_MULTI_PERFORM;
while (ret == CURLM_CALL_MULTI_PERFORM) {
ret = curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
mp_timedout = TRUE;
break;
}
}
if (mp_timedout)
break;

Просмотреть файл

@ -75,14 +75,10 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
do {
ret = curl_multi_perform(multi, &still_running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
MULTI_PERFORM_HANG_TIMEOUT)
mp_timedout = TRUE;
break;
}
} while (ret == CURLM_CALL_MULTI_PERFORM);
ml_timedout = FALSE;
ml_start = tutil_tvnow();
@ -116,20 +112,18 @@ int test(char *URL)
default:
mp_timedout = FALSE;
mp_start = tutil_tvnow();
do {
ret = curl_multi_perform(multi, &still_running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
MULTI_PERFORM_HANG_TIMEOUT)
mp_timedout = TRUE;
break;
}
} while (ret == CURLM_CALL_MULTI_PERFORM);
break;
}
}
if (ml_timedout || mp_timedout) {
if (ml_timedout) fprintf(stderr, "ml_timedout\n");
if (mp_timedout) fprintf(stderr, "mp_timedout\n");
if (ml_timedout)
fprintf(stderr, "ml_timedout\n");
if (mp_timedout)
fprintf(stderr, "mp_timedout\n");
fprintf(stderr, "ABORTING TEST, since it seems "
"that it would have run forever.\n");
i = TEST_ERR_RUNS_FOREVER;

Просмотреть файл

@ -151,7 +151,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -162,9 +161,6 @@ int test(char *URL)
done = TRUE;
break;
}
}
if (mp_timedout || done)
break;
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");

Просмотреть файл

@ -149,7 +149,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -186,13 +185,11 @@ int test(char *URL)
break;
}
}
else
else {
done = TRUE; /* bail out */
break;
}
}
if (mp_timedout || done)
break;
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");
@ -215,8 +212,6 @@ int test(char *URL)
res = 195;
break;
}
res = CURLM_CALL_MULTI_PERFORM;
}
if (ml_timedout || mp_timedout) {

Просмотреть файл

@ -161,7 +161,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -172,9 +171,6 @@ int test(char *URL)
done = TRUE; /* bail out */
break;
}
}
if (mp_timedout || done)
break;
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");

Просмотреть файл

@ -99,7 +99,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -127,13 +126,11 @@ int test(char *URL)
break;
}
}
else
else {
done = TRUE; /* bail out */
break;
}
}
if (mp_timedout || done)
break;
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");

Просмотреть файл

@ -59,8 +59,6 @@ static CURLMcode perform(CURLM * multi)
switch (code) {
case CURLM_OK:
break;
case CURLM_CALL_MULTI_PERFORM:
continue;
default:
return code;
}

Просмотреть файл

@ -87,9 +87,7 @@ static int loop(CURLM *cm, const char* url, const char* userpwd,
while (U) {
do {
code = curl_multi_perform(cm, &U);
} while (code == CURLM_CALL_MULTI_PERFORM);
if (U) {
FD_ZERO(&R);

Просмотреть файл

@ -63,9 +63,7 @@ int test(char *URL)
curl_multi_add_handle(multi_handle, http_handle);
/* we start some action by calling perform right away */
do {
code = curl_multi_perform(multi_handle, &still_running);
} while(code == CURLM_CALL_MULTI_PERFORM);
while(still_running) {
struct timeval timeout;
@ -100,9 +98,7 @@ int test(char *URL)
case 0:
default:
/* timeout or readable/writable sockets */
do {
code = curl_multi_perform(multi_handle, &still_running);
} while(code == CURLM_CALL_MULTI_PERFORM);
break;
}
}

Просмотреть файл

@ -98,7 +98,6 @@ int test(char *URL)
mp_timedout = FALSE;
mp_start = tutil_tvnow();
while (res == CURLM_CALL_MULTI_PERFORM) {
res = (int)curl_multi_perform(m, &running);
if (tutil_tvdiff(tutil_tvnow(), mp_start) >
MULTI_PERFORM_HANG_TIMEOUT) {
@ -109,9 +108,6 @@ int test(char *URL)
done = TRUE; /* bail out */
break;
}
}
if (mp_timedout || done)
break;
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");
@ -134,8 +130,6 @@ int test(char *URL)
res = 195;
break;
}
res = CURLM_CALL_MULTI_PERFORM;
}
if (ml_timedout || mp_timedout) {

Просмотреть файл

@ -81,8 +81,7 @@ int test(char *URL)
curl_multi_add_handle(mhandle, handle);
while(CURLM_CALL_MULTI_PERFORM ==
curl_multi_perform(mhandle, &still_running));
curl_multi_perform(mhandle, &still_running);
while(still_running) {
static struct timeval timeout = /* 100 ms */ { 0, 100000L };
@ -108,8 +107,7 @@ int test(char *URL)
goto test_cleanup;
}
else {
while(CURLM_CALL_MULTI_PERFORM ==
curl_multi_perform(mhandle, &still_running));
curl_multi_perform(mhandle, &still_running);
}
}

Просмотреть файл

@ -182,8 +182,7 @@ static void notifyCurl(CURL* curl, curl_socket_t s, int evBitmask,
{
int numhandles = 0;
CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles);
if (result != CURLM_OK && result != CURLM_CALL_MULTI_PERFORM)
{
if (result != CURLM_OK) {
fprintf(stderr, "Curl error on %s: %i (%s)\n",
info, result, curl_multi_strerror(result));
}
@ -196,10 +195,8 @@ static void checkFdSet(CURL* curl, struct Sockets* sockets, fd_set* fdset,
int evBitmask, const char* name)
{
int i;
for (i = 0; i < sockets->count; ++i)
{
if (FD_ISSET(sockets->sockets[i], fdset))
{
for (i = 0; i < sockets->count; ++i) {
if (FD_ISSET(sockets->sockets[i], fdset)) {
notifyCurl(curl, sockets->sockets[i], evBitmask, name);
}
}