1
/*****************************************************************************
1
/***************************************************************************
3
3
* Project ___| | | | _ \| |
4
4
* / __| | | | |_) | |
5
5
* | (__| |_| | _ <| |___
6
6
* \___|\___/|_| \_\_____|
8
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
10
* In order to be useful for every potential user, curl and libcurl are
11
* dual-licensed under the MPL and the MIT/X-derivate licenses.
8
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
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 http://curl.haxx.se/docs/copyright.html.
13
14
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
14
15
* copies of the Software, and permit persons to whom the Software is
15
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
16
* licenses. You may pick one of these licenses.
16
* furnished to do so, under the terms of the COPYING file.
18
18
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
* KIND, either express or implied.
21
* $Id: getinfo.c,v 1.18 2002/02/20 13:46:54 bagder Exp $
22
*****************************************************************************/
21
* $Id: getinfo.c,v 1.36 2004/03/11 21:51:55 bagder Exp $
22
***************************************************************************/
26
26
#include <curl/curl.h>
28
28
#include "urldata.h"
31
32
#include <string.h>
95
104
case CURLINFO_EFFECTIVE_URL:
96
105
*param_charp = data->change.url?data->change.url:(char *)"";
98
case CURLINFO_HTTP_CODE:
107
case CURLINFO_RESPONSE_CODE:
99
108
*param_longp = data->info.httpcode;
110
case CURLINFO_HTTP_CONNECTCODE:
111
*param_longp = data->info.httpproxycode;
101
113
case CURLINFO_FILETIME:
102
114
*param_longp = data->info.filetime;
123
135
*param_doublep = data->progress.t_starttransfer;
125
137
case CURLINFO_SIZE_UPLOAD:
126
*param_doublep = data->progress.uploaded;
138
*param_doublep = (double)data->progress.uploaded;
128
140
case CURLINFO_SIZE_DOWNLOAD:
129
*param_doublep = data->progress.downloaded;
141
*param_doublep = (double)data->progress.downloaded;
131
143
case CURLINFO_SPEED_DOWNLOAD:
132
*param_doublep = data->progress.dlspeed;
144
*param_doublep = (double)data->progress.dlspeed;
134
146
case CURLINFO_SPEED_UPLOAD:
135
*param_doublep = data->progress.ulspeed;
147
*param_doublep = (double)data->progress.ulspeed;
137
149
case CURLINFO_SSL_VERIFYRESULT:
138
150
*param_longp = data->set.ssl.certverifyresult;
140
152
case CURLINFO_CONTENT_LENGTH_DOWNLOAD:
141
*param_doublep = data->progress.size_dl;
153
*param_doublep = (double)data->progress.size_dl;
143
155
case CURLINFO_CONTENT_LENGTH_UPLOAD:
144
*param_doublep = data->progress.size_ul;
156
*param_doublep = (double)data->progress.size_ul;
158
case CURLINFO_REDIRECT_TIME:
159
*param_doublep = data->progress.t_redirect;
161
case CURLINFO_REDIRECT_COUNT:
162
*param_longp = data->set.followlocation;
146
164
case CURLINFO_CONTENT_TYPE:
147
165
*param_charp = data->info.contenttype;
167
case CURLINFO_PRIVATE:
168
*param_charp = data->set.private;
170
case CURLINFO_HTTPAUTH_AVAIL:
171
*param_longp = data->info.httpauthavail;
173
case CURLINFO_PROXYAUTH_AVAIL:
174
*param_longp = data->info.proxyauthavail;
150
177
return CURLE_BAD_FUNCTION_ARGUMENT;
157
* eval: (load-file "../curl-mode.el")
160
* vim: et sw=2 ts=2 sts=2 tw=78