aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib504.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-03-17 17:20:26 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-03-17 17:20:26 +0000
commit8319ea70787ab197f1433621be040aa9584c320f (patch)
treebe4c5c847fe84fe91233e9622640a821a49917ed /tests/libtest/lib504.c
parent5334a58f9bd177961dc55485dcc98353244db5d0 (diff)
more defensive checking as platforms differ...
Diffstat (limited to 'tests/libtest/lib504.c')
-rw-r--r--tests/libtest/lib504.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c
index d340c509c..9acd71bdf 100644
--- a/tests/libtest/lib504.c
+++ b/tests/libtest/lib504.c
@@ -34,11 +34,13 @@ CURLcode test(char *URL)
m = curl_multi_init();
+ res = curl_multi_add_handle(m, c);
+ if(res && (res != CURLM_CALL_MULTI_PERFORM))
+ return 1; /* major failure */
do {
- res = curl_multi_add_handle(m, c);
- while (res == CURLM_CALL_MULTI_PERFORM)
+ do {
res = curl_multi_perform(m, &running);
-
+ } while (res == CURLM_CALL_MULTI_PERFORM);
if(!running) {
/* This is where this code is expected to reach */
int numleft;
@@ -50,6 +52,7 @@ CURLcode test(char *URL)
ret = 99; /* not correct */
break;
}
+ fprintf(stderr, "running %d res %d\n", running, res);
if (res != CURLM_OK) {
fprintf(stderr, "not okay???\n");
@@ -62,16 +65,17 @@ CURLcode test(char *URL)
FD_ZERO(&exc);
max_fd = 0;
+ fprintf(stderr, "_fdset()\n");
if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
fprintf(stderr, "unexpected failured of fdset.\n");
ret = 3;
break;
}
-
+ fprintf(stderr, "select\n");
select(max_fd+1, &rd, &wr, &exc, NULL);
- fprintf(stderr, "not reached!\n");
- } while(0);
+ fprintf(stderr, "loop!\n");
+ } while(1);
curl_multi_remove_handle(m, c);
curl_easy_cleanup(c);