6ca712f48b398912fa24069a67ab05bcd0cacfa1
[platform/upstream/curl.git] / docs / libcurl / curl_easy_getinfo.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH curl_easy_getinfo 3 "11 Feb 2009" "libcurl 7.19.4" "libcurl Manual"
24 .SH NAME
25 curl_easy_getinfo - extract information from a curl handle
26 .SH SYNOPSIS
27 .B #include <curl/curl.h>
28
29 .B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
30
31 .SH DESCRIPTION
32 Request internal information from the curl session with this function.  The
33 third argument \fBMUST\fP be a pointer to a long, a pointer to a char *, a
34 pointer to a struct curl_slist * or a pointer to a double (as this
35 documentation describes further down).  The data pointed-to will be filled in
36 accordingly and can be relied upon only if the function returns CURLE_OK.  Use
37 this function AFTER a performed transfer if you want to get transfer related
38 data.
39
40 You should not free the memory returned by this function unless it is
41 explicitly mentioned below.
42 .SH AVAILABLE INFORMATION
43 The following information can be extracted:
44
45 .IP CURLINFO_EFFECTIVE_URL
46 Last used URL.
47 See \fICURLINFO_EFFECTIVE_URL(3)\fP
48
49 .IP CURLINFO_RESPONSE_CODE
50 Last received response code.
51 See \fICURLINFO_RESPONSE_CODE(3)\fP
52
53 .IP CURLINFO_HTTP_CONNECTCODE
54 Last proxy CONNECT response code.
55 See \fICURLINFO_HTTP_CONNECTCODE(3)\fP
56
57 .IP CURLINFO_FILETIME
58 Remote time of the retrieved document.
59 See \fICURLINFO_FILETIME(3)\fP
60
61 .IP CURLINFO_TOTAL_TIME
62 Total time of previous transfer.
63 See \fICURLINFO_TOTAL_TIME(3)\fP
64
65 .IP CURLINFO_NAMELOOKUP_TIME
66 Time from start until name resolving completed.
67 See \fICURLINFO_NAMELOOKUP_TIME(3)\fP
68
69 .IP CURLINFO_CONNECT_TIME
70 Time from start until remote host or proxy completed.
71 See \fICURLINFO_CONNECT_TIME(3)\fP
72
73 .IP CURLINFO_APPCONNECT_TIME
74 Time from start until SSL/SSH handshake completed.
75 See \fICURLINFO_APPCONNECT_TIME(3)\fP
76
77 .IP CURLINFO_PRETRANSFER_TIME
78 Time from start until just before the transfer begins.
79 See \fICURLINFO_PRETRANSFER_TIME(3)\fP
80
81 .IP CURLINFO_STARTTRANSFER_TIME
82 Time from start until just when the first byte is received.
83 See \fICURLINFO_STARTTRANSFER_TIME(3)\fP
84
85 .IP CURLINFO_REDIRECT_TIME
86 Time taken for all redirect steps before the final transfer.
87 See \fICURLINFO_REDIRECT_TIME(3)\fP
88
89 .IP CURLINFO_REDIRECT_COUNT
90 Total number of redirects that were followed.
91 See \fICURLINFO_REDIRECT_COUNT(3)\fP
92
93 .IP CURLINFO_REDIRECT_URL
94 URL a redirect would take you to, had you enabled redirects.
95 See \fICURLINFO_REDIRECT_URL(3)\fP
96
97 .IP CURLINFO_SIZE_UPLOAD
98 Number of bytes uploaded.
99 See \fICURLINFO_SIZE_UPLOAD(3)\fP
100
101 .IP CURLINFO_SIZE_DOWNLOAD
102 Number of bytes downloaded.
103 See \fICURLINFO_SIZE_DOWNLOAD(3)\fP
104
105 .IP CURLINFO_SPEED_DOWNLOAD
106 Average download speed.
107 See \fICURLINFO_SPEED_DOWNLOAD(3)\fP
108
109 .IP CURLINFO_SPEED_UPLOAD
110 Average upload speed.
111 See \fICURLINFO_SPEED_UPLOAD(3)\fP
112
113 .IP CURLINFO_HEADER_SIZE
114 Number of bytes of all headers received.
115 See \fICURLINFO_HEADER_SIZE(3)\fP
116
117 .IP CURLINFO_REQUEST_SIZE
118 Number of bytes sent in the issued HTTP requests.
119 See \fICURLINFO_REQUEST_SIZE(3)\fP
120
121 .IP CURLINFO_SSL_VERIFYRESULT
122 Certificate verification result.
123 See \fICURLINFO_SSL_VERIFYRESULT(3)\fP
124
125 .IP CURLINFO_SSL_ENGINES
126 A list of OpenSSL crypto engines.
127 See \fICURLINFO_SSL_ENGINES(3)\fP
128
129 .IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
130 Content length from the Content-Length header.
131 See \fICURLINFO_CONTENT_LENGTH_DOWNLOAD(3)\fP
132
133 .IP CURLINFO_CONTENT_LENGTH_UPLOAD
134 Upload size.
135 See \fICURLINFO_CONTENT_LENGTH_UPLOAD(3)\fP
136
137 .IP CURLINFO_CONTENT_TYPE
138 Content type from the Content-Type header.
139 See \fICURLINFO_CONTENT_TYPE(3)\fP
140
141 .IP CURLINFO_PRIVATE
142 User's private data pointer.
143 See \fICURLINFO_PRIVATE(3)\fP
144
145 .IP CURLINFO_HTTPAUTH_AVAIL
146 Available HTTP authentication methods.
147 See \fICURLINFO_HTTPAUTH_AVAIL(3)\fP
148
149 .IP CURLINFO_PROXYAUTH_AVAIL
150 Available HTTP proxy authentication methods.
151 See \fICURLINFO_PROXYAUTH_AVAIL(3)\fP
152
153 .IP CURLINFO_OS_ERRNO
154 The errno from the last failure to connect.
155 See \fICURLINFO_OS_ERRNO(3)\fP
156
157 .IP CURLINFO_NUM_CONNECTS
158 Number of new successful connections used for previous transfer.
159 See \fICURLINFO_NUM_CONNECTS(3)\fP
160
161 .IP CURLINFO_PRIMARY_IP
162 IP address of the last connection.
163 See \fICURLINFO_PRIMARY_IP(3)\fP
164
165 .IP CURLINFO_PRIMARY_PORT
166 Port of the last connection.
167 See \fICURLINFO_PRIMARY_PORT(3)\fP
168
169 .IP CURLINFO_LOCAL_IP
170 Local-end IP address of last connection.
171 See \fICURLINFO_LOCAL_IP(3)\fP
172
173 .IP CURLINFO_LOCAL_PORT
174 Local-end port of last connection.
175 See \fICURLINFO_LOCAL_PORT(3)\fP
176
177 .IP CURLINFO_COOKIELIST
178 List of all known cookies.
179 See \fICURLINFO_COOKIELIST(3)\fP
180
181 .IP CURLINFO_LASTSOCKET
182 Last socket used.
183 See \fICURLINFO_LASTSOCKET(3)\fP
184
185 .IP CURLINFO_ACTIVESOCKET
186 The session's active socket.
187 See \fICURLINFO_ACTIVESOCKET(3)\fP
188
189 .IP CURLINFO_FTP_ENTRY_PATH
190 The entry path after logging in to an FTP server.
191 See \fICURLINFO_FTP_ENTRY_PATH(3)\fP
192
193 .IP CURLINFO_CERTINFO
194 Certificate chain.
195 See \fICURLINFO_CERTINFO(3)\fP
196
197 .IP CURLINFO_TLS_SSL_PTR
198 TLS session info that can be used for further processing.
199 See \fICURLINFO_TLS_SSL_PTR(3)\fP
200
201 .IP CURLINFO_CONDITION_UNMET
202 Whether or not a time conditional was met.
203 See \fICURLINFO_CONDITION_UNMET(3)\fP
204
205 .IP CURLINFO_RTSP_SESSION_ID
206 RTSP session ID.
207 See \fICURLINFO_RTSP_SESSION_ID(3)\fP
208
209 .IP CURLINFO_RTSP_CLIENT_CSEQ
210 RTSP CSeq that will next be used.
211 See \fICURLINFO_RTSP_CLIENT_CSEQ(3)\fP
212
213 .IP CURLINFO_RTSP_SERVER_CSEQ
214 RTSP CSeq that will next be expected.
215 See \fICURLINFO_RTSP_SERVER_CSEQ(3)\fP
216
217 .IP CURLINFO_RTSP_CSEQ_RECV
218 RTSP CSeq last received.
219 See \fICURLINFO_RTSP_CSEQ_RECV(3)\fP
220
221 .SH TIMES
222 .nf
223 An overview of the six time values available from curl_easy_getinfo()
224
225 curl_easy_perform()
226     |
227     |--NAMELOOKUP
228     |--|--CONNECT
229     |--|--|--APPCONNECT
230     |--|--|--|--PRETRANSFER
231     |--|--|--|--|--STARTTRANSFER
232     |--|--|--|--|--|--TOTAL
233     |--|--|--|--|--|--REDIRECT
234 .fi
235 .IP NAMELOOKUP
236 \fICURLINFO_NAMELOOKUP_TIME\fP. The time it took from the start until the name
237 resolving was completed.
238 .IP CONNECT
239 \fICURLINFO_CONNECT_TIME\fP. The time it took from the start until the connect
240 to the remote host (or proxy) was completed.
241 .IP APPCONNECT
242 \fICURLINFO_APPCONNECT_TIME\fP. The time it took from the start until the SSL
243 connect/handshake with the remote host was completed. (Added in in 7.19.0)
244 .IP PRETRANSFER
245 \fICURLINFO_PRETRANSFER_TIME\fP. The time it took from the start until the
246 file transfer is just about to begin. This includes all pre-transfer commands
247 and negotiations that are specific to the particular protocol(s) involved.
248 .IP STARTTRANSFER
249 \fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
250 first byte is received by libcurl.
251 .IP TOTAL
252 \fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
253 .IP REDIRECT
254 \fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
255 include name lookup, connect, pretransfer and transfer before final
256 transaction was started. So, this is zero if no redirection took place.
257 .SH RETURN VALUE
258 If the operation was successful, CURLE_OK is returned. Otherwise an
259 appropriate error code will be returned.
260 .SH "SEE ALSO"
261 .BR curl_easy_setopt "(3)"