mirror of
https://github.com/curl/curl.git
synced 2026-04-21 11:12:13 +03:00
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.
This commit is contained in:
parent
54faab69cb
commit
4c070de4fb
5 changed files with 10 additions and 10 deletions
|
|
@ -144,7 +144,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 */
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ int main(void)
|
|||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue