From 1d173f3413235de45828301ad554314fc8384ddf Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 7 Sep 2018 16:15:24 +0200 Subject: docs/examples: do not wait when no transfers are running Closes #2948 --- docs/examples/multi-single.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/examples/multi-single.c') diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index 70b6d24b2..3dca0f1af 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -51,7 +51,7 @@ int main(void) CURL *http_handle; CURLM *multi_handle; - int still_running; /* keep number of running handles */ + int still_running = 0; /* keep number of running handles */ int repeats = 0; curl_global_init(CURL_GLOBAL_DEFAULT); @@ -70,7 +70,7 @@ int main(void) /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); - do { + while(still_running) { CURLMcode mc; /* curl_multi_wait() return code */ int numfds; @@ -97,7 +97,7 @@ int main(void) repeats = 0; curl_multi_perform(multi_handle, &still_running); - } while(still_running); + } curl_multi_remove_handle(multi_handle, http_handle); -- cgit v1.2.3