returned memory should not be freed
[platform/upstream/curl.git] / docs / libcurl / curl_easy_getinfo.3
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" $Id$
4 .\"
5 .TH curl_easy_getinfo 3 "20 Aug 2003" "libcurl 7.10.8" "libcurl Manual"
6 .SH NAME
7 curl_easy_getinfo - extract information from a curl handle
8 .SH SYNOPSIS
9 .B #include <curl/curl.h>
10
11 .B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
12
13 .SH DESCRIPTION
14 Request internal information from the curl session with this function.  The
15 third argument
16 .B MUST
17 be a pointer to a long, a pointer to a char * or a pointer to a double (as
18 this documentation describes further down).  The data pointed-to will be
19 filled in accordingly and can be relied upon only if the function returns
20 CURLE_OK.  This function is intended to get used *AFTER* a performed transfer,
21 all results from this function are undefined until the transfer is completed.
22
23 You should not free the memory returned by this function unless it is
24 explictly mentioned below.
25 .SH AVAILABLE INFORMATION
26 The following information can be extracted:
27 .IP CURLINFO_EFFECTIVE_URL
28 Pass a pointer to a 'char *' to receive the last used effective URL.
29 .IP CURLINFO_RESPONSE_CODE
30 Pass a pointer to a long to receive the last received HTTP or FTP code. This
31 option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier.
32 .IP CURLINFO_FILETIME
33 Pass a pointer to a long to receive the remote time of the retrieved
34 document. If you get -1, it can be because of many reasons (unknown, the
35 server hides it or the server doesn't support the command that tells document
36 time etc) and the time of the document is unknown. Note that you must tell the
37 server to collect this information before the transfer is made, by using the
38 CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5)
39 .IP CURLINFO_TOTAL_TIME
40 Pass a pointer to a double to receive the total transaction time in seconds
41 for the previous transfer. This time does not include the connect time, so if
42 you want the complete operation time, you should add the
43 CURLINFO_CONNECT_TIME.
44 .IP CURLINFO_NAMELOOKUP_TIME
45 Pass a pointer to a double to receive the time, in seconds, it took from the
46 start until the name resolving was completed.
47 .IP CURLINFO_CONNECT_TIME
48 Pass a pointer to a double to receive the time, in seconds, it took from the
49 start until the connect to the remote host (or proxy) was completed.
50 .IP CURLINFO_PRETRANSFER_TIME
51 Pass a pointer to a double to receive the time, in seconds, it took from the
52 start until the file transfer is just about to begin. This includes all
53 pre-transfer commands and negotiations that are specific to the particular
54 protocol(s) involved.
55 .IP CURLINFO_STARTTRANSFER_TIME
56 Pass a pointer to a double to receive the time, in seconds, it took from the
57 start until the first byte is just about to be transferred. This includes
58 CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate
59 the result.
60 .IP CURLINFO_REDIRECT_TIME
61 Pass a pointer to a double to receive the total time, in seconds, it took for
62 all redirection steps include name lookup, connect, pretransfer and transfer
63 before final transaction was started. CURLINFO_REDIRECT_TIME contains the
64 complete execution time for multiple redirections.  (Added in 7.9.7)
65 .IP CURLINFO_REDIRECT_COUNT
66 Pass a pointer to a long to receive the total number of redirections that were
67 actually followed.  (Added in 7.9.7)
68 .IP CURLINFO_SIZE_UPLOAD
69 Pass a pointer to a double to receive the total amount of bytes that were
70 uploaded.
71 .IP CURLINFO_SIZE_DOWNLOAD
72 Pass a pointer to a double to receive the total amount of bytes that were
73 downloaded. The amount is only for the latest transfer and will be reset again
74 for each new transfer.
75 .IP CURLINFO_SPEED_DOWNLOAD
76 Pass a pointer to a double to receive the average download speed that curl
77 measured for the complete download.
78 .IP CURLINFO_SPEED_UPLOAD
79 Pass a pointer to a double to receive the average upload speed that curl
80 measured for the complete upload.
81 .IP CURLINFO_HEADER_SIZE
82 Pass a pointer to a long to receive the total size of all the headers
83 received.
84 .IP CURLINFO_REQUEST_SIZE
85 Pass a pointer to a long to receive the total size of the issued
86 requests. This is so far only for HTTP requests. Note that this may be more
87 than one request if FOLLOWLOCATION is true.
88 .IP CURLINFO_SSL_VERIFYRESULT
89 Pass a pointer to a long to receive the result of the certification
90 verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to
91 \fIcurl_easy_setopt(3)\fP).
92 .IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
93 Pass a pointer to a double to receive the content-length of the download. This
94 is the value read from the Content-Length: field.
95 .IP CURLINFO_CONTENT_LENGTH_UPLOAD
96 Pass a pointer to a double to receive the specified size of the upload.
97 .IP CURLINFO_CONTENT_TYPE
98 Pass a pointer to a 'char *' to receive the content-type of the downloaded
99 object. This is the value read from the Content-Type: field. If you get NULL,
100 it means that the server didn't send a valid Content-Type header or that the
101 protocol used doesn't support this.
102 .IP CURLINFO_PRIVATE
103 Pass a pointer to a 'char *' to receive the pointer to the private data
104 associated with the curl handle (set with the CURLOPT_PRIVATE option to
105 \fIcurl_easy_setopt(3)\fP). (Added in 7.10.3)
106 .IP CURLINFO_HTTPAUTH_AVAIL
107 Pass a pointer to a long to receive a bitmask indicating the authentication
108 method(s) available. The meaning of the bits is explained in the
109 CURLOPT_HTTPAUTH option for \fIcurl_easy_setopt(3)\fP.  (Added in 7.10.8)
110 .IP CURLINFO_PROXYAUTH_AVAIL
111 Pass a pointer to a long to receive a bitmask indicating the authentication
112 method(s) available for your proxy authentication.  (Added in 7.10.8)
113 .SH RETURN VALUE
114 If the operation was successful, CURLE_OK is returned. Otherwise an
115 appropriate error code will be returned.
116 .SH "SEE ALSO"
117 .BR curl_easy_setopt "(3)"