diff options
Diffstat (limited to 'tests/libtest/lib536.c')
-rw-r--r-- | tests/libtest/lib536.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index 40b45e47d..53439c797 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -21,8 +21,9 @@ static CURLMcode perform(CURLM * multi) int handles, maxfd; CURLMcode code; fd_set fdread, fdwrite, fdexcep; + int loop; - for (;;) { + for (loop=40;loop>0;loop--) { code = curl_multi_perform(multi, &handles); if (handles <= 0) return CURLM_OK; @@ -45,6 +46,11 @@ static CURLMcode perform(CURLM * multi) if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, 0) == -1) return (CURLMcode) ~CURLM_OK; } + if (loop <= 0) { + fprintf(stderr, "ABORTING TEST, since it seems " + "that it would have run forever.\n"); + return (CURLMcode) ~CURLM_OK; + } } int test(char *URL) |