1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3<html><head> 4<title>CURLOPT_DEBUGFUNCTION man page</title> 5<meta name="generator" content="roffit"> 6<STYLE type="text/css"> 7P.level0 { 8 padding-left: 2em; 9} 10 11P.level1 { 12 padding-left: 4em; 13} 14 15P.level2 { 16 padding-left: 6em; 17} 18 19span.emphasis { 20 font-style: italic; 21} 22 23span.bold { 24 font-weight: bold; 25} 26 27span.manpage { 28 font-weight: bold; 29} 30 31h2.nroffsh { 32 background-color: #e0e0e0; 33} 34 35span.nroffip { 36 font-weight: bold; 37 font-size: 120%; 38 font-family: monospace; 39} 40 41p.roffit { 42 text-align: center; 43 font-size: 80%; 44} 45</STYLE> 46</head><body> 47 48<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2> 49<p class="level0">CURLOPT_DEBUGFUNCTION - debug callback <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2> 50<p class="level0"><pre> 51<p class="level0">#include <curl/curl.h> 52 <p class="level0">typedef enum { 53 CURLINFO_TEXT = 0, 54 CURLINFO_HEADER_IN, /* 1 */ 55 CURLINFO_HEADER_OUT, /* 2 */ 56 CURLINFO_DATA_IN, /* 3 */ 57 CURLINFO_DATA_OUT, /* 4 */ 58 CURLINFO_SSL_DATA_IN, /* 5 */ 59 CURLINFO_SSL_DATA_OUT, /* 6 */ 60 CURLINFO_END 61 } curl_infotype; 62 <p class="level0">int debug_callback(CURL *handle, 63 curl_infotype type, 64 char *data, 65 size_t size, 66 void *userptr); 67 <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DEBUGFUNCTION, 68 debug_callback); 69 </pre> 70<a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2> 71<p class="level0">Pass a pointer to your callback function, which should match the prototype shown above. 72<p class="level0"><a Class="emphasis" href="/CURLOPT_DEBUGFUNCTION.html">CURLOPT_DEBUGFUNCTION</a> replaces the standard debug function used when <a Class="emphasis" href="/CURLOPT_VERBOSE.html">CURLOPT_VERBOSE</a> is in effect. This callback receives debug information, as specified in the <span Class="emphasis">type</span> argument. This function must return 0. The <span Class="emphasis">data</span> pointed to by the char * passed to this function WILL NOT be zero terminated, but will be exactly of the <span Class="emphasis">size</span> as told by the <span Class="emphasis">size</span> argument. 73<p class="level0">The <span Class="emphasis">userptr</span> argument is the pointer set with <a Class="emphasis" href="/CURLOPT_DEBUGDATA.html">CURLOPT_DEBUGDATA</a>. 74<p class="level0">Available curl_infotype values: 75<p class="level0"><a name="CURLINFOTEXT"></a><span class="nroffip">CURLINFO_TEXT</span> 76<p class="level1">The data is informational text. 77<p class="level0"><a name="CURLINFOHEADERIN"></a><span class="nroffip">CURLINFO_HEADER_IN</span> 78<p class="level1">The data is header (or header-like) data received from the peer. 79<p class="level0"><a name="CURLINFOHEADEROUT"></a><span class="nroffip">CURLINFO_HEADER_OUT</span> 80<p class="level1">The data is header (or header-like) data sent to the peer. 81<p class="level0"><a name="CURLINFODATAIN"></a><span class="nroffip">CURLINFO_DATA_IN</span> 82<p class="level1">The data is protocol data received from the peer. 83<p class="level0"><a name="CURLINFODATAOUT"></a><span class="nroffip">CURLINFO_DATA_OUT</span> 84<p class="level1">The data is protocol data sent to the peer. 85<p class="level0"><a name="CURLINFOSSLDATAOUT"></a><span class="nroffip">CURLINFO_SSL_DATA_OUT</span> 86<p class="level1">The data is SSL/TLS (binary) data sent to the peer. 87<p class="level0"><a name="CURLINFOSSLDATAIN"></a><span class="nroffip">CURLINFO_SSL_DATA_IN</span> 88<p class="level1">The data is SSL/TLS (binary) data received from the peer. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2> 89<p class="level0">NULL <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2> 90<p class="level0">All <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2> 91<p class="level0"><a href="http://curl.haxx.se/libcurl/c/debug.html">http://curl.haxx.se/libcurl/c/debug.html</a> <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2> 92<p class="level0">Always <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2> 93<p class="level0">Returns CURLE_OK <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2> 94<p class="level0"><a Class="manpage" href="/CURLOPT_VERBOSE.html">CURLOPT_VERBOSE</a> <a Class="manpage" href="/CURLOPT_DEBUGDATA.html">CURLOPT_DEBUGDATA</a> <span Class="manpage"> </span> <p class="roffit"> 95 This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>. 96</body></html> 97