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/http2-upload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/examples/http2-upload.c') diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 06ff04091..2717998ca 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -245,7 +245,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 */ const char *filename = "index.html"; if(argc > 1) @@ -279,7 +279,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 */ @@ -348,7 +348,7 @@ int main(int argc, char **argv) curl_multi_perform(multi_handle, &still_running); break; } - } while(still_running); + } curl_multi_cleanup(multi_handle); -- cgit v1.2.3