~ubuntu-branches/ubuntu/natty/curl/natty-security

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2010-06-20 13:56:28 UTC
  • mfrom: (3.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100620135628-e30tp9jldq6hq985
Tags: 7.21.0-1ubuntu1
* Merge from debian unstable.  Remaining changes: LP: #596334
  - Keep build deps in main:
    - Drop build dependencies: stunnel, libssh2-1-dev
    - Add build-dependency on openssh-server
    - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: multi-single.c,v 1.6 2006-10-13 14:01:20 bagder Exp $
9
8
 *
10
9
 * This is a very simple example using the multi interface.
11
10
 */
52
51
    fd_set fdread;
53
52
    fd_set fdwrite;
54
53
    fd_set fdexcep;
55
 
    int maxfd;
 
54
    int maxfd = -1;
56
55
 
57
56
    FD_ZERO(&fdread);
58
57
    FD_ZERO(&fdwrite);
66
65
    curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
67
66
 
68
67
    /* In a real-world program you OF COURSE check the return code of the
69
 
       function calls, *and* you make sure that maxfd is bigger than -1 so
70
 
       that the call to select() below makes sense! */
 
68
       function calls.  On success, the value of maxfd is guaranteed to be
 
69
       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
 
70
       case of (maxfd == -1), we call select(0, ...), which is basically equal
 
71
       to sleep. */
71
72
 
72
73
    rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
73
74