diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-01-04 14:11:35 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-01-04 14:11:35 +0000 |
commit | 69c2084a1897229390c94549a5b837b722ceffc6 (patch) | |
tree | 2938f14452e8a29698e92542779b52b5e82f1eee /hiper/hiper.c | |
parent | 99c0a1a7d06a26c5a07f1157c5423ab4275e698b (diff) |
updated test programs to use the API as it currently works
Diffstat (limited to 'hiper/hiper.c')
-rw-r--r-- | hiper/hiper.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hiper/hiper.c b/hiper/hiper.c index 6114b548c..0cfa7bba0 100644 --- a/hiper/hiper.c +++ b/hiper/hiper.c @@ -296,7 +296,7 @@ int main(int argc, char **argv) curl_easy_setopt(e, CURLOPT_URL, conns[i].url); curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, writecallback); curl_easy_setopt(e, CURLOPT_WRITEDATA, &conns[i]); -#if 0 +#if 1 curl_easy_setopt(e, CURLOPT_VERBOSE, 1); #endif curl_easy_setopt(e, CURLOPT_ERRORBUFFER, conns[i].error); @@ -319,6 +319,7 @@ int main(int argc, char **argv) while(still_running == num_total) { struct timeval timeout; int rc; /* select() return code */ + long timeout_ms; fd2_set fdread; fd2_set fdwrite; @@ -329,9 +330,11 @@ int main(int argc, char **argv) FD2_ZERO(&fdwrite); FD2_ZERO(&fdexcep); - /* set a suitable timeout to play around with */ - timeout.tv_sec = 0; - timeout.tv_usec = 50000; + curl_multi_timeout(multi_handle, &timeout_ms); + + /* set timeout to wait */ + timeout.tv_sec = timeout_ms/1000; + timeout.tv_usec = (timeout_ms%1000)*1000; /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, |