aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-06-17 17:07:15 +0200
committerKamil Dudka <kdudka@redhat.com>2010-06-17 17:07:15 +0200
commitd63bdba0977a3d680138a89d46015d1ef690f5cd (patch)
tree30e2d525db7f6b1732be041731d98afbebd0f25d /tests/libtest
parent43edcc4a2eb0aa1dec888cad7b2a66b3a4948026 (diff)
test575: do not fail with threaded DNS resolver
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib575.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/libtest/lib575.c b/tests/libtest/lib575.c
index 49a379e80..521720e95 100644
--- a/tests/libtest/lib575.c
+++ b/tests/libtest/lib575.c
@@ -71,7 +71,7 @@ int test(char *URL)
curl_multi_perform(mhandle, &still_running));
while(still_running) {
- struct timeval timeout;
+ static struct timeval timeout = /* 100 ms */ { 0, 100000L };
int rc;
fd_set fdread;
fd_set fdwrite;
@@ -80,23 +80,19 @@ int test(char *URL)
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
- timeout.tv_sec = 3;
- timeout.tv_usec = 0;
m = curl_multi_fdset(mhandle, &fdread, &fdwrite, &fdexcep, &max_fdset);
if(m != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() error\n");
goto test_cleanup;
}
+ /* We call select(max_fdset + 1, ...), specially in case of (maxfd == -1),
+ * we call select(0, ...), which is basically equal to sleep. */
rc = select(max_fdset + 1, &fdread, &fdwrite, &fdexcep, &timeout);
if(rc == -1) {
fprintf(stderr, "select() error\n");
goto test_cleanup;
}
- else if(rc == 0) {
- fprintf(stderr, "select() timeout!\n");
- goto test_cleanup;
- }
else {
while(CURLM_CALL_MULTI_PERFORM ==
curl_multi_perform(mhandle, &still_running));