~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to docs/examples/debug.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-18 15:21:57 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080618152157-qq94aiequcq35w6b
Tags: 7.18.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop the stunnel build dependency.
  - Drop the build-dependency on libdb4.5-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: debug.c,v 1.2 2006-10-20 21:26:10 bagder Exp $
 
8
 * $Id: debug.c,v 1.4 2008-05-22 21:20:09 danf Exp $
9
9
 */
10
10
 
11
11
#include <stdio.h>
65
65
 
66
66
static
67
67
int my_trace(CURL *handle, curl_infotype type,
68
 
             unsigned char *data, size_t size,
 
68
             char *data, size_t size,
69
69
             void *userp)
70
70
{
71
71
  struct data *config = (struct data *)userp;
98
98
    break;
99
99
  }
100
100
 
101
 
  dump(text, stderr, data, size, config->trace_ascii);
 
101
  dump(text, stderr, (unsigned char *)data, size, config->trace_ascii);
102
102
  return 0;
103
103
}
104
104
 
116
116
    curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
117
117
 
118
118
    /* the DEBUGFUNCTION has no effect until we enable VERBOSE */
119
 
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 
119
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
120
120
 
121
121
    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
122
122
    res = curl_easy_perform(curl);