From 4c070de4fb01b4fbf29f8c463ba96da97b36bd2f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 23 Jul 2012 15:34:25 +0000 Subject: examples: use do/while loop for multi examples It's conceivable that after the first time curl_multi_perform returns, the outvalue still_running will be 0, but work will have been done. This is shown by a workload of small, purely file:// based URLs. Ensure that we always read pending messages off the multi handle by forcing the while loop to run at least once. --- docs/examples/multi-double.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/examples/multi-double.c') diff --git a/docs/examples/multi-double.c b/docs/examples/multi-double.c index 120fde7b8..91422e6e2 100644 --- a/docs/examples/multi-double.c +++ b/docs/examples/multi-double.c @@ -59,7 +59,7 @@ int main(void) /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); - while(still_running) { + do { struct timeval timeout; int rc; /* select() return code */ @@ -108,7 +108,7 @@ int main(void) curl_multi_perform(multi_handle, &still_running); break; } - } + } while(still_running); curl_multi_cleanup(multi_handle); -- cgit v1.2.3