5
5
.\" * | (__| |_| | _ <| |___
6
6
.\" * \___|\___/|_| \_\_____|
8
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
8
.\" * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
.\" * This software is licensed as described in the file COPYING, which
11
11
.\" * you should have received as part of this distribution. The terms
18
18
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
.\" * KIND, either express or implied.
21
.\" * $Id: curl_easy_getinfo.3,v 1.33 2008-04-30 21:20:09 bagder Exp $
21
.\" * $Id: curl_easy_getinfo.3,v 1.40 2009-02-23 18:45:00 bagder Exp $
22
22
.\" **************************************************************************
24
.TH curl_easy_getinfo 3 "21 Mar 2006" "libcurl 7.15.4" "libcurl Manual"
24
.TH curl_easy_getinfo 3 "11 Feb 2009" "libcurl 7.19.4" "libcurl Manual"
26
26
curl_easy_getinfo - extract information from a curl handle
71
71
.IP CURLINFO_CONNECT_TIME
72
72
Pass a pointer to a double to receive the time, in seconds, it took from the
73
73
start until the connect to the remote host (or proxy) was completed.
74
.IP CURLINFO_APPCONNECT_TIME
75
Pass a pointer to a double to receive the time, in seconds, it took from the
76
start until the SSL/SSH connect/handshake to the remote host was completed.
77
This time is most often very near to the PRETRANSFER time, except for cases
78
such as HTTP pippelining where the pretransfer time can be delayed due to
79
waits in line for the pipeline and more. (Added in 7.19.0)
74
80
.IP CURLINFO_PRETRANSFER_TIME
75
81
Pass a pointer to a double to receive the time, in seconds, it took from the
76
82
start until the file transfer is just about to begin. This includes all
128
134
data for you. (Added in 7.12.3)
129
135
.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
130
136
Pass a pointer to a double to receive the content-length of the download. This
131
is the value read from the Content-Length: field.
137
is the value read from the Content-Length: field. Since 7.19.4, this returns -1
138
if the size isn't known.
132
139
.IP CURLINFO_CONTENT_LENGTH_UPLOAD
133
Pass a pointer to a double to receive the specified size of the upload.
140
Pass a pointer to a double to receive the specified size of the upload. Since
141
7.19.4, this returns -1 if the size isn't known.
134
142
.IP CURLINFO_CONTENT_TYPE
135
143
Pass a pointer to a 'char *' to receive the content-type of the downloaded
136
144
object. This is the value read from the Content-Type: field. If you get NULL,
159
167
how many times libcurl successfully reused existing connection(s) or not. See
160
168
the Connection Options of \fIcurl_easy_setopt(3)\fP to see how libcurl tries
161
169
to make persistent connections to save time. (Added in 7.12.3)
170
.IP CURLINFO_PRIMARY_IP
171
Pass a pointer to a char pointer to receive the pointer to a zero-terminated
172
string holding the IP address of the most recent connection done with this
173
\fBcurl\fP handle. This string may be IPv6 if that's enabled. Note that you
174
get a pointer to a memory area that will be re-used at next request so you
175
need to copy the string if you want to keep the information. (Added in 7.19.0)
162
176
.IP CURLINFO_COOKIELIST
163
177
Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all
164
178
cookies cURL knows (expired ones, too). Don't forget to
178
192
of the entry path. That is the initial path libcurl ended up in when logging
179
193
on to the remote FTP server. This stores a NULL as pointer if something is
180
194
wrong. (Added in 7.15.4)
195
.IP CURLINFO_CERTINFO
196
Pass a pointer to a 'struct curl_certinfo *' and you'll get it set to point to
197
struct that holds a number of linked lists with info about the certificate
198
chain, assuming you had CURLOPT_CERTINFO enabled when the previous request was
199
done. The struct reports how many certs it found and then you can extract info
200
for each of those certs by following the linked lists. The info chain is
201
provided in a series of data in the format "name:content" where the content is
202
for the specific named data. See also the certinfo.c example. NOTE: this
203
option is only available in libcurl built with OpenSSL support. (Added in
205
.IP CURLINFO_CONDITION_UNMET
206
Pass a pointer to a long to receive the number 1 if the condition provided in
207
the previous request didn't match (see \fICURLOPT_TIMECONDITION\fP). Alas, if
208
this returns a 1 you know that the reason you didn't get data in return is
209
because it didn't fulfill the condition. The long ths argument points to will
210
get a zero stored if the condition instead was met. (Added in 7.19.4)
183
213
An overview of the six time values available from curl_easy_getinfo()
185
215
curl_easy_perform()
220
|--|--|--|--PRETRANSFER
221
|--|--|--|--|--STARTTRANSFER
222
|--|--|--|--|--|--TOTAL
223
|--|--|--|--|--|--REDIRECT
195
226
\fICURLINFO_NAMELOOKUP_TIME\fP. The time it took from the start until the name
196
227
resolving was completed.
198
229
\fICURLINFO_CONNECT_TIME\fP. The time it took from the start until the connect
199
230
to the remote host (or proxy) was completed.
232
\fICURLINFO_APPCONNECT_TIME\fP. The time it took from the start until the SSL
233
connect/handshake with the remote host was completed. (Added in in 7.19.0)
201
235
\fICURLINFO_PRETRANSFER_TIME\fP. The time it took from the start until the
202
236
file transfer is just about to begin. This includes all pre-transfer commands
203
237
and negotiations that are specific to the particular protocol(s) involved.
205
239
\fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
206
240
first byte is just about to be transferred.
208
242
\fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
210
244
\fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
211
245
include name lookup, connect, pretransfer and transfer before final
212
246
transaction was started. So, this is zero if no redirection took place.