aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-01-21 09:53:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2010-01-21 09:53:30 +0000
commita74e885befcded7dd958563badaaf8a5f29587aa (patch)
tree1173fb3abdae973ec29a31af1ccdd6e253b80fd6 /docs
parent6291a1cf231227acb5165fc884e3ddbb2f322958 (diff)
Yun Fu pointed out a flaw in the loop that checks handles, and I indented
the code more curl-style
Diffstat (limited to 'docs')
-rw-r--r--docs/examples/multi-app.c31
1 files changed, 17 insertions, 14 deletions
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 && (idx<HANDLECOUNT)); idx++) found = (msg->easy_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; idx<HANDLECOUNT; idx++) {
+ found = (msg->easy_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;
+ }
}
}