diff options
author | Kamil Dudka <kdudka@redhat.com> | 2018-09-07 16:15:24 +0200 |
---|---|---|
committer | Kamil Dudka <kdudka@redhat.com> | 2018-09-10 12:23:23 +0200 |
commit | 1d173f3413235de45828301ad554314fc8384ddf (patch) | |
tree | f687e04a25494abf41357c501c7213b007484ad4 /docs/examples/http2-download.c | |
parent | 2099dde2c84a57cd9fe2298f0953c5dca0e94d43 (diff) | |
download | curl-1d173f3413235de45828301ad554314fc8384ddf.tar.gz |
docs/examples: do not wait when no transfers are running
Closes #2948
Diffstat (limited to 'docs/examples/http2-download.c')
-rw-r--r-- | docs/examples/http2-download.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 3425d302f..b4ac7c93e 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -189,7 +189,7 @@ int main(int argc, char **argv) CURL *easy[NUM_HANDLES]; CURLM *multi_handle; int i; - int still_running; /* keep number of running handles */ + int still_running = 0; /* keep number of running handles */ if(argc > 1) /* if given a number, do that many transfers */ @@ -215,7 +215,7 @@ int main(int argc, char **argv) /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); - do { + while(still_running) { struct timeval timeout; int rc; /* select() return code */ CURLMcode mc; /* curl_multi_fdset() return code */ @@ -284,7 +284,7 @@ int main(int argc, char **argv) curl_multi_perform(multi_handle, &still_running); break; } - } while(still_running); + } curl_multi_cleanup(multi_handle); |