~ubuntu-branches/ubuntu/edgy/curl/edgy-updates

« back to all changes in this revision

Viewing changes to docs/examples/multi-app.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-03-23 18:41:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050323184129-le70d05a0hk5w62j
Tags: 7.12.3-2ubuntu3
Fix the version numbers internal to debian/rules.  Closes; #8088

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
 
 *                                  _   _ ____  _     
3
 
 *  Project                     ___| | | |  _ \| |    
4
 
 *                             / __| | | | |_) | |    
5
 
 *                            | (__| |_| |  _ <| |___ 
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: multi-app.c,v 1.4 2003/08/28 11:21:14 bagder Exp $
 
8
 * $Id: multi-app.c,v 1.6 2004/10/06 13:24:08 giva Exp $
9
9
 *
10
10
 * This is an example application source code using the multi interface.
11
11
 */
24
24
 * Download a HTTP file and upload an FTP file simultaneously.
25
25
 */
26
26
 
27
 
#define HANDLECOUNT 2   /* Number of simultaneous transfers */
28
 
#define HTTP_HANDLE 0   /* Index for the HTTP transfer */
29
 
#define FTP_HANDLE 1    /* Index for the FTP transfer */
 
27
#define HANDLECOUNT 2   /* Number of simultaneous transfers */
 
28
#define HTTP_HANDLE 0   /* Index for the HTTP transfer */
 
29
#define FTP_HANDLE 1    /* Index for the FTP transfer */
30
30
 
31
31
int main(int argc, char **argv)
32
32
{
98
98
    }
99
99
  }
100
100
 
101
 
  curl_multi_cleanup(multi_handle);
102
 
 
103
101
  /* See how the transfers went */
104
102
  while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
105
103
    if (msg->msg == CURLMSG_DONE) {
111
109
 
112
110
       switch (idx) {
113
111
         case HTTP_HANDLE:
114
 
           printf("HTTP transfer completed with status %d\n", msg->data.result);
115
 
           break;
116
 
         case FTP_HANDLE:
117
 
           printf("FTP transfer completed with status %d\n", msg->data.result);
118
 
           break;
 
112
           printf("HTTP transfer completed with status %d\n", msg->data.result);
 
113
           break;
 
114
         case FTP_HANDLE:
 
115
           printf("FTP transfer completed with status %d\n", msg->data.result);
 
116
           break;
119
117
       }
120
118
    }
121
119
  }
122
120
 
 
121
  curl_multi_cleanup(multi_handle);
 
122
 
123
123
  /* Free the CURL handles */
124
124
  for (i=0; i<HANDLECOUNT; i++)
125
125
      curl_easy_cleanup(handles[i]);