the TOTAL_TIME is not really total, as it excludes the connect time...
[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_init 3 "25 Apr 2002" "libcurl 7.9.7" "libcurl Manual"
6 .SH NAME
7 curl_easy_getinfo - Extract information from a curl session (added in 7.4)
8 .SH SYNOPSIS
9 .B #include <curl/curl.h>
10 .sp
11 .BI "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
12 .ad
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 .SH AVAILABLE INFORMATION
23 These are informations that can be extracted:
24 .TP 0.8i
25 .B CURLINFO_EFFECTIVE_URL
26 Pass a pointer to a 'char *' to receive the last used effective URL.
27 .TP
28 .B CURLINFO_HTTP_CODE
29 Pass a pointer to a long to receive the last received HTTP code.
30 .TP
31 .B CURLINFO_FILETIME
32 Pass a pointer to a long to receive the remote time of the retrieved
33 document. If you get -1, it can be because of many reasons (unknown, the
34 server hides it or the server doesn't support the command that tells document
35 time etc) and the time of the document is unknown. Note that you must tell the
36 server to collect this information before the transfer is made, by using the
37 CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5)
38 .TP
39 .B 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 .TP
45 .B CURLINFO_NAMELOOKUP_TIME
46 Pass a pointer to a double to receive the time, in seconds, it took from the
47 start until the name resolving was completed.
48 .TP
49 .B CURLINFO_CONNECT_TIME
50 Pass a pointer to a double to receive the time, in seconds, it took from the
51 start until the connect to the remote host (or proxy) was completed.
52 .TP
53 .B CURLINFO_PRETRANSFER_TIME
54 Pass a pointer to a double to receive the time, in seconds, it took from the
55 start until the file transfer is just about to begin. This includes all
56 pre-transfer commands and negotiations that are specific to the particular
57 protocol(s) involved.
58 .TP
59 .B CURLINFO_STARTTRANSFER_TIME
60 Pass a pointer to a double to receive the time, in seconds, it took from the
61 start until the first byte is just about to be transfered. This includes
62 CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate
63 the result.
64 .TP
65 .B CURLINFO_REDIRECT_TIME
66 Pass a pointer to a double to receive the total time, in seconds, it took for
67 all redirection steps include name lookup, connect, pretransfer and transfer
68 before final transaction was started. CURLINFO_REDIRECT_TIME contains the
69 complete execution time for multiple redirections.  (Added in 7.9.7)
70 .TP
71 .B CURLINFO_REDIRECT_COUNT
72 Pass a pointer to a long to receive the total number of redirections that were
73 actually followed.  (Added in 7.9.7)
74 .TP
75 .B CURLINFO_SIZE_UPLOAD
76 Pass a pointer to a double to receive the total amount of bytes that were
77 uploaded.
78 .TP
79 .B CURLINFO_SIZE_DOWNLOAD
80 Pass a pointer to a double to receive the total amount of bytes that were
81 downloaded.
82 .TP
83 .B CURLINFO_SPEED_DOWNLOAD
84 Pass a pointer to a double to receive the average download speed that curl
85 measured for the complete download.
86 .TP
87 .B CURLINFO_SPEED_UPLOAD
88 Pass a pointer to a double to receive the average upload speed that curl
89 measured for the complete upload.
90 .TP
91 .B CURLINFO_HEADER_SIZE
92 Pass a pointer to a long to receive the total size of all the headers
93 received.
94 .TP
95 .B CURLINFO_REQUEST_SIZE
96 Pass a pointer to a long to receive the total size of the issued
97 requests. This is so far only for HTTP requests. Note that this may be more
98 than one request if FOLLOWLOCATION is true.
99 .TP
100 .B CURLINFO_SSL_VERIFYRESULT
101 Pass a pointer to a long to receive the result of the certification
102 verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to
103 curl_easy_setopt). (Added in 7.4.2)
104 .TP
105 .B CURLINFO_CONTENT_LENGTH_DOWNLOAD
106 Pass a pointer to a double to receive the content-length of the download. This
107 is the value read from the Content-Length: field.  (Added in 7.6.1)
108 .TP
109 .B CURLINFO_CONTENT_LENGTH_UPLOAD
110 Pass a pointer to a double to receive the specified size of the upload.
111 (Added in 7.6.1)
112 .TP
113 .B CURLINFO_CONTENT_TYPE
114 Pass a pointer to a 'char *' to receive the content-type of the downloaded
115 object. This is the value read from the Content-Type: field. If you get NULL,
116 it means that the server didn't send a valid Content-Type header or that the
117 protocol used doesn't support this.  (Added in 7.9.4)
118 .PP
119
120 .SH RETURN VALUE
121 If the operation was successful, CURLE_OK is returned. Otherwise an
122 appropriate error code will be returned.
123 .SH "SEE ALSO"
124 .BR curl_easy_setopt "(3)"
125 .SH BUGS
126 Surely there are some, you tell me!