| 1 |
.\" ************************************************************************** |
| 2 |
.\" * _ _ ____ _ |
| 3 |
.\" * Project ___| | | | _ \| | |
| 4 |
.\" * / __| | | | |_) | | |
| 5 |
.\" * | (__| |_| | _ <| |___ |
| 6 |
.\" * \___|\___/|_| \_\_____| |
| 7 |
.\" * |
| 8 |
.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <[email protected]>, 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 |
.IP CURLINFO_EFFECTIVE_URL |
| 45 |
Last used URL. |
| 46 |
See \fICURLINFO_EFFECTIVE_URL(3)\fP |
| 47 |
.IP CURLINFO_RESPONSE_CODE |
| 48 |
Last received response code. |
| 49 |
See \fICURLINFO_RESPONSE_CODE(3)\fP |
| 50 |
.IP CURLINFO_HTTP_CONNECTCODE |
| 51 |
Last proxy CONNECT response code. |
| 52 |
See \fICURLINFO_HTTP_CONNECTCODE(3)\fP |
| 53 |
.IP CURLINFO_HTTP_VERSION |
| 54 |
The http version used in the connection. |
| 55 |
See \fICURLINFO_HTTP_VERSION(3)\fP |
| 56 |
.IP CURLINFO_FILETIME |
| 57 |
Remote time of the retrieved document. See \fICURLINFO_FILETIME(3)\fP |
| 58 |
.IP CURLINFO_FILETIME_T |
| 59 |
Remote time of the retrieved document. See \fICURLINFO_FILETIME_T(3)\fP |
| 60 |
.IP CURLINFO_TOTAL_TIME |
| 61 |
Total time of previous transfer. |
| 62 |
See \fICURLINFO_TOTAL_TIME(3)\fP |
| 63 |
.IP CURLINFO_TOTAL_TIME_T |
| 64 |
Total time of previous transfer. |
| 65 |
See \fICURLINFO_TOTAL_TIME_T(3)\fP |
| 66 |
.IP CURLINFO_NAMELOOKUP_TIME |
| 67 |
Time from start until name resolving completed. |
| 68 |
See \fICURLINFO_NAMELOOKUP_TIME(3)\fP |
| 69 |
.IP CURLINFO_NAMELOOKUP_TIME_T |
| 70 |
Time from start until name resolving completed. |
| 71 |
See \fICURLINFO_NAMELOOKUP_TIME_T(3)\fP |
| 72 |
.IP CURLINFO_CONNECT_TIME |
| 73 |
Time from start until remote host or proxy completed. |
| 74 |
See \fICURLINFO_CONNECT_TIME(3)\fP |
| 75 |
.IP CURLINFO_CONNECT_TIME_T |
| 76 |
Time from start until remote host or proxy completed. |
| 77 |
See \fICURLINFO_CONNECT_TIME_T(3)\fP |
| 78 |
.IP CURLINFO_APPCONNECT_TIME |
| 79 |
Time from start until SSL/SSH handshake completed. |
| 80 |
See \fICURLINFO_APPCONNECT_TIME(3)\fP |
| 81 |
.IP CURLINFO_APPCONNECT_TIME_T |
| 82 |
Time from start until SSL/SSH handshake completed. |
| 83 |
See \fICURLINFO_APPCONNECT_TIME_T(3)\fP |
| 84 |
.IP CURLINFO_PRETRANSFER_TIME |
| 85 |
Time from start until just before the transfer begins. |
| 86 |
See \fICURLINFO_PRETRANSFER_TIME(3)\fP |
| 87 |
.IP CURLINFO_PRETRANSFER_TIME_T |
| 88 |
Time from start until just before the transfer begins. |
| 89 |
See \fICURLINFO_PRETRANSFER_TIME_T(3)\fP |
| 90 |
.IP CURLINFO_STARTTRANSFER_TIME |
| 91 |
Time from start until just when the first byte is received. |
| 92 |
See \fICURLINFO_STARTTRANSFER_TIME(3)\fP |
| 93 |
.IP CURLINFO_STARTTRANSFER_TIME_T |
| 94 |
Time from start until just when the first byte is received. |
| 95 |
See \fICURLINFO_STARTTRANSFER_TIME_T(3)\fP |
| 96 |
.IP CURLINFO_REDIRECT_TIME |
| 97 |
Time taken for all redirect steps before the final transfer. |
| 98 |
See \fICURLINFO_REDIRECT_TIME(3)\fP |
| 99 |
.IP CURLINFO_REDIRECT_TIME_T |
| 100 |
Time taken for all redirect steps before the final transfer. |
| 101 |
See \fICURLINFO_REDIRECT_TIME_T(3)\fP |
| 102 |
.IP CURLINFO_REDIRECT_COUNT |
| 103 |
Total number of redirects that were followed. |
| 104 |
See \fICURLINFO_REDIRECT_COUNT(3)\fP |
| 105 |
.IP CURLINFO_REDIRECT_URL |
| 106 |
URL a redirect would take you to, had you enabled redirects. |
| 107 |
See \fICURLINFO_REDIRECT_URL(3)\fP |
| 108 |
.IP CURLINFO_SIZE_UPLOAD |
| 109 |
(Deprecated) Number of bytes uploaded. |
| 110 |
See \fICURLINFO_SIZE_UPLOAD(3)\fP |
| 111 |
.IP CURLINFO_SIZE_UPLOAD_T |
| 112 |
Number of bytes uploaded. |
| 113 |
See \fICURLINFO_SIZE_UPLOAD_T(3)\fP |
| 114 |
.IP CURLINFO_SIZE_DOWNLOAD |
| 115 |
(Deprecated) Number of bytes downloaded. |
| 116 |
See \fICURLINFO_SIZE_DOWNLOAD(3)\fP |
| 117 |
.IP CURLINFO_SIZE_DOWNLOAD_T |
| 118 |
Number of bytes downloaded. |
| 119 |
See \fICURLINFO_SIZE_DOWNLOAD_T(3)\fP |
| 120 |
.IP CURLINFO_SPEED_DOWNLOAD |
| 121 |
(Deprecated) Average download speed. |
| 122 |
See \fICURLINFO_SPEED_DOWNLOAD(3)\fP |
| 123 |
.IP CURLINFO_SPEED_DOWNLOAD_T |
| 124 |
Average download speed. |
| 125 |
See \fICURLINFO_SPEED_DOWNLOAD_T(3)\fP |
| 126 |
.IP CURLINFO_SPEED_UPLOAD |
| 127 |
(Deprecated) Average upload speed. |
| 128 |
See \fICURLINFO_SPEED_UPLOAD(3)\fP |
| 129 |
.IP CURLINFO_SPEED_UPLOAD_T |
| 130 |
Average upload speed. |
| 131 |
See \fICURLINFO_SPEED_UPLOAD_T(3)\fP |
| 132 |
.IP CURLINFO_HEADER_SIZE |
| 133 |
Number of bytes of all headers received. |
| 134 |
See \fICURLINFO_HEADER_SIZE(3)\fP |
| 135 |
.IP CURLINFO_REQUEST_SIZE |
| 136 |
Number of bytes sent in the issued HTTP requests. |
| 137 |
See \fICURLINFO_REQUEST_SIZE(3)\fP |
| 138 |
.IP CURLINFO_SSL_VERIFYRESULT |
| 139 |
Certificate verification result. |
| 140 |
See \fICURLINFO_SSL_VERIFYRESULT(3)\fP |
| 141 |
.IP CURLINFO_PROXY_SSL_VERIFYRESULT |
| 142 |
Proxy certificate verification result. |
| 143 |
See \fICURLINFO_PROXY_SSL_VERIFYRESULT(3)\fP |
| 144 |
.IP CURLINFO_SSL_ENGINES |
| 145 |
A list of OpenSSL crypto engines. |
| 146 |
See \fICURLINFO_SSL_ENGINES(3)\fP |
| 147 |
.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD |
| 148 |
(Deprecated) Content length from the Content-Length header. |
| 149 |
See \fICURLINFO_CONTENT_LENGTH_DOWNLOAD(3)\fP |
| 150 |
.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD_T |
| 151 |
Content length from the Content-Length header. |
| 152 |
See \fICURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)\fP |
| 153 |
.IP CURLINFO_CONTENT_LENGTH_UPLOAD |
| 154 |
(Deprecated) Upload size. See \fICURLINFO_CONTENT_LENGTH_UPLOAD(3)\fP |
| 155 |
.IP CURLINFO_CONTENT_LENGTH_UPLOAD_T |
| 156 |
Upload size. See \fICURLINFO_CONTENT_LENGTH_UPLOAD_T(3)\fP |
| 157 |
.IP CURLINFO_CONTENT_TYPE |
| 158 |
Content type from the Content-Type header. |
| 159 |
See \fICURLINFO_CONTENT_TYPE(3)\fP |
| 160 |
.IP CURLINFO_RETRY_AFTER |
| 161 |
The value from the from the Retry-After header. |
| 162 |
See \fICURLINFO_RETRY_AFTER(3)\fP |
| 163 |
.IP CURLINFO_PRIVATE |
| 164 |
User's private data pointer. |
| 165 |
See \fICURLINFO_PRIVATE(3)\fP |
| 166 |
.IP CURLINFO_HTTPAUTH_AVAIL |
| 167 |
Available HTTP authentication methods. |
| 168 |
See \fICURLINFO_HTTPAUTH_AVAIL(3)\fP |
| 169 |
.IP CURLINFO_PROXYAUTH_AVAIL |
| 170 |
Available HTTP proxy authentication methods. |
| 171 |
See \fICURLINFO_PROXYAUTH_AVAIL(3)\fP |
| 172 |
.IP CURLINFO_OS_ERRNO |
| 173 |
The errno from the last failure to connect. |
| 174 |
See \fICURLINFO_OS_ERRNO(3)\fP |
| 175 |
.IP CURLINFO_NUM_CONNECTS |
| 176 |
Number of new successful connections used for previous transfer. |
| 177 |
See \fICURLINFO_NUM_CONNECTS(3)\fP |
| 178 |
.IP CURLINFO_PRIMARY_IP |
| 179 |
IP address of the last connection. |
| 180 |
See \fICURLINFO_PRIMARY_IP(3)\fP |
| 181 |
.IP CURLINFO_PRIMARY_PORT |
| 182 |
Port of the last connection. |
| 183 |
See \fICURLINFO_PRIMARY_PORT(3)\fP |
| 184 |
.IP CURLINFO_LOCAL_IP |
| 185 |
Local-end IP address of last connection. |
| 186 |
See \fICURLINFO_LOCAL_IP(3)\fP |
| 187 |
.IP CURLINFO_LOCAL_PORT |
| 188 |
Local-end port of last connection. |
| 189 |
See \fICURLINFO_LOCAL_PORT(3)\fP |
| 190 |
.IP CURLINFO_COOKIELIST |
| 191 |
List of all known cookies. |
| 192 |
See \fICURLINFO_COOKIELIST(3)\fP |
| 193 |
.IP CURLINFO_LASTSOCKET |
| 194 |
Last socket used. |
| 195 |
See \fICURLINFO_LASTSOCKET(3)\fP |
| 196 |
.IP CURLINFO_ACTIVESOCKET |
| 197 |
The session's active socket. |
| 198 |
See \fICURLINFO_ACTIVESOCKET(3)\fP |
| 199 |
.IP CURLINFO_FTP_ENTRY_PATH |
| 200 |
The entry path after logging in to an FTP server. |
| 201 |
See \fICURLINFO_FTP_ENTRY_PATH(3)\fP |
| 202 |
.IP CURLINFO_CERTINFO |
| 203 |
Certificate chain. |
| 204 |
See \fICURLINFO_CERTINFO(3)\fP |
| 205 |
.IP CURLINFO_TLS_SSL_PTR |
| 206 |
TLS session info that can be used for further processing. |
| 207 |
See \fICURLINFO_TLS_SSL_PTR(3)\fP |
| 208 |
.IP CURLINFO_TLS_SESSION |
| 209 |
TLS session info that can be used for further processing. See |
| 210 |
\fICURLINFO_TLS_SESSION(3)\fP. Deprecated option, use |
| 211 |
\fICURLINFO_TLS_SSL_PTR(3)\fP instead! |
| 212 |
.IP CURLINFO_CONDITION_UNMET |
| 213 |
Whether or not a time conditional was met. |
| 214 |
See \fICURLINFO_CONDITION_UNMET(3)\fP |
| 215 |
.IP CURLINFO_RTSP_SESSION_ID |
| 216 |
RTSP session ID. |
| 217 |
See \fICURLINFO_RTSP_SESSION_ID(3)\fP |
| 218 |
.IP CURLINFO_RTSP_CLIENT_CSEQ |
| 219 |
RTSP CSeq that will next be used. |
| 220 |
See \fICURLINFO_RTSP_CLIENT_CSEQ(3)\fP |
| 221 |
.IP CURLINFO_RTSP_SERVER_CSEQ |
| 222 |
RTSP CSeq that will next be expected. |
| 223 |
See \fICURLINFO_RTSP_SERVER_CSEQ(3)\fP |
| 224 |
.IP CURLINFO_RTSP_CSEQ_RECV |
| 225 |
RTSP CSeq last received. |
| 226 |
See \fICURLINFO_RTSP_CSEQ_RECV(3)\fP |
| 227 |
.IP CURLINFO_PROTOCOL |
| 228 |
The protocol used for the connection. (Added in 7.52.0) |
| 229 |
See \fICURLINFO_PROTOCOL(3)\fP |
| 230 |
.IP CURLINFO_SCHEME |
| 231 |
The scheme used for the connection. (Added in 7.52.0) |
| 232 |
See \fICURLINFO_SCHEME(3)\fP |
| 233 |
.SH TIMES |
| 234 |
.nf |
| 235 |
An overview of the six time values available from curl_easy_getinfo() |
| 236 |
|
| 237 |
curl_easy_perform() |
| 238 |
| |
| 239 |
|--NAMELOOKUP |
| 240 |
|--|--CONNECT |
| 241 |
|--|--|--APPCONNECT |
| 242 |
|--|--|--|--PRETRANSFER |
| 243 |
|--|--|--|--|--STARTTRANSFER |
| 244 |
|--|--|--|--|--|--TOTAL |
| 245 |
|--|--|--|--|--|--REDIRECT |
| 246 |
.fi |
| 247 |
.IP NAMELOOKUP |
| 248 |
\fICURLINFO_NAMELOOKUP_TIME\fP and \fICURLINFO_NAMELOOKUP_TIME_T\fP. |
| 249 |
The time it took from the start until the name resolving was completed. |
| 250 |
.IP CONNECT |
| 251 |
\fICURLINFO_CONNECT_TIME\fP and \fICURLINFO_CONNECT_TIME_T\fP. |
| 252 |
The time it took from the start until the connect |
| 253 |
to the remote host (or proxy) was completed. |
| 254 |
.IP APPCONNECT |
| 255 |
\fICURLINFO_APPCONNECT_TIME\fP and \fICURLINFO_APPCONNECT_TIME_T\fP. |
| 256 |
The time it took from the start until the SSL |
| 257 |
connect/handshake with the remote host was completed. (Added in 7.19.0) |
| 258 |
The latter is the integer version (measuring microseconds). (Added in 7.60.0) |
| 259 |
.IP PRETRANSFER |
| 260 |
\fICURLINFO_PRETRANSFER_TIME\fP and \fICURLINFO_PRETRANSFER_TIME_T\fP. |
| 261 |
The time it took from the start until the |
| 262 |
file transfer is just about to begin. This includes all pre-transfer commands |
| 263 |
and negotiations that are specific to the particular protocol(s) involved. |
| 264 |
.IP STARTTRANSFER |
| 265 |
\fICURLINFO_STARTTRANSFER_TIME\fP and \fICURLINFO_STARTTRANSFER_TIME_T\fP. |
| 266 |
The time it took from the start until the |
| 267 |
first byte is received by libcurl. |
| 268 |
.IP TOTAL |
| 269 |
\fICURLINFO_TOTAL_TIME\fP and \fICURLINFO_TOTAL_TIME_T\fP. |
| 270 |
Total time of the previous request. |
| 271 |
.IP REDIRECT |
| 272 |
\fICURLINFO_REDIRECT_TIME\fP and \fICURLINFO_REDIRECT_TIME_T\fP. |
| 273 |
The time it took for all redirection steps |
| 274 |
include name lookup, connect, pretransfer and transfer before final |
| 275 |
transaction was started. So, this is zero if no redirection took place. |
| 276 |
.SH RETURN VALUE |
| 277 |
If the operation was successful, CURLE_OK is returned. Otherwise an |
| 278 |
appropriate error code will be returned. |
| 279 |
.SH "SEE ALSO" |
| 280 |
.BR curl_easy_setopt "(3)" |