From 8319ea70787ab197f1433621be040aa9584c320f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 17 Mar 2003 17:20:26 +0000 Subject: more defensive checking as platforms differ... --- tests/libtest/lib504.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tests/libtest') 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); -- cgit v1.2.3