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

« back to all changes in this revision

Viewing changes to docs/examples/multi-debugcallback.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-debugcallback.c,v 1.5 2009-06-05 18:40:40 yangtse Exp $
9
8
 *
10
9
 * This is a very simple example using the multi interface and the debug
11
10
 * callback.
141
140
    fd_set fdread;
142
141
    fd_set fdwrite;
143
142
    fd_set fdexcep;
144
 
    int maxfd;
 
143
    int maxfd = -1;
145
144
 
146
145
    FD_ZERO(&fdread);
147
146
    FD_ZERO(&fdwrite);
155
154
    curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
156
155
 
157
156
    /* In a real-world program you OF COURSE check the return code of the
158
 
       function calls, *and* you make sure that maxfd is bigger than -1
159
 
       so that the call to select() below makes sense! */
 
157
       function calls.  On success, the value of maxfd is guaranteed to be
 
158
       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
 
159
       case of (maxfd == -1), we call select(0, ...), which is basically equal
 
160
       to sleep. */
160
161
 
161
162
    rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
162
163