aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib504.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-04-27 10:59:43 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-04-27 10:59:43 +0000
commit2f53da5e7ae16fc66c87ed479c8cdc20cb6305fd (patch)
treef9a016b9909a4485de3b2f0658d1ab51d2b9162a /tests/libtest/lib504.c
parent58f1cc0b5ff8fdf533f26898a778a747d37d8e8a (diff)
make the loop use a fixed number of attempts to prevent eternal loops
Diffstat (limited to 'tests/libtest/lib504.c')
-rw-r--r--tests/libtest/lib504.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c
index bfffd3971..5f2c6acfc 100644
--- a/tests/libtest/lib504.c
+++ b/tests/libtest/lib504.c
@@ -20,6 +20,7 @@ int test(char *URL)
int running;
int max_fd;
int rc;
+ int loop=100;
curl_global_init(CURL_GLOBAL_ALL);
c = curl_easy_init();
@@ -78,7 +79,9 @@ int test(char *URL)
rc = select(max_fd+1, &rd, &wr, &exc, &interval);
fprintf(stderr, "select returned %d\n", rc);
- } while(rc);
+ /* we only allow a certain number of loops to avoid hanging here
+ forever */
+ } while(rc && (--loop>0));
curl_multi_remove_handle(m, c);
curl_easy_cleanup(c);