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

« back to all changes in this revision

Viewing changes to docs/examples/multi-double.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:
1
1
/*****************************************************************************
2
 
 *                                  _   _ ____  _     
3
 
 *  Project                     ___| | | |  _ \| |    
4
 
 *                             / __| | | | |_) | |    
5
 
 *                            | (__| |_| |  _ <| |___ 
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: multi-double.c,v 1.4 2006-10-13 14:01:19 bagder Exp $
9
8
 *
10
9
 * This is a very simple example using the multi interface.
11
10
 */
58
57
    fd_set fdread;
59
58
    fd_set fdwrite;
60
59
    fd_set fdexcep;
61
 
    int maxfd;
 
60
    int maxfd = -1;
62
61
 
63
62
    FD_ZERO(&fdread);
64
63
    FD_ZERO(&fdwrite);
72
71
    curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
73
72
 
74
73
    /* In a real-world program you OF COURSE check the return code of the
75
 
       function calls, *and* you make sure that maxfd is bigger than -1 so
76
 
       that the call to select() below makes sense! */
 
74
       function calls.  On success, the value of maxfd is guaranteed to be
 
75
       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
 
76
       case of (maxfd == -1), we call select(0, ...), which is basically equal
 
77
       to sleep. */
77
78
 
78
79
    rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
79
80