From a74e885befcded7dd958563badaaf8a5f29587aa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 21 Jan 2010 09:53:30 +0000 Subject: Yun Fu pointed out a flaw in the loop that checks handles, and I indented the code more curl-style --- docs/examples/multi-app.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'docs/examples/multi-app.c') diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index a8a92ab33..fa3349822 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -105,20 +105,23 @@ int main(int argc, char **argv) /* See how the transfers went */ while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { - - int idx, found = 0; - - /* Find out which handle this message is about */ - for (idx=0; (!found && (idxeasy_handle == handles[idx]); - - switch (idx) { - case HTTP_HANDLE: - printf("HTTP transfer completed with status %d\n", msg->data.result); - break; - case FTP_HANDLE: - printf("FTP transfer completed with status %d\n", msg->data.result); - break; - } + int idx, found = 0; + + /* Find out which handle this message is about */ + for (idx=0; idxeasy_handle == handles[idx]); + if(found) + break; + } + + switch (idx) { + case HTTP_HANDLE: + printf("HTTP transfer completed with status %d\n", msg->data.result); + break; + case FTP_HANDLE: + printf("FTP transfer completed with status %d\n", msg->data.result); + break; + } } } -- cgit v1.2.3