cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Adding CURLINFO_CONTENT_LENGTH to curl_getinfo()

From: Bob Schader <rschader_at_product-des.com>
Date: Fri, 02 Feb 2001 06:43:29 -0500

Well, if you try it out like I did, at least when only
requesting headers, CURLINFO_SIZE_UPLOAD and CURLINFO_SIZE_DOWNLOAD
both return 0.0 because they access data->progress.uploaded
and data->progress.downloaded, but accessing data->progress.size_ul
and data->progress.size_dl instead returns the content-length
value of the file, which is where progress.c gets the total
it reports even when no file was transferred. No overkill there.

Bob Schader

Daniel Stenberg wrote:
>
> On Thu, 1 Feb 2001, Bob Schader wrote:
>
> > CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
> > CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
>
> > Add the following case statement to curl_getinfo() in
> > lib/getinfo.c's switch(info) statement:
> >
> > case CURLINFO_CONTENT_LENGTH:
> > *param_longp = (long)(data->progress.size_dl +
> > data->progress.size_ul);
> > break;
>
> Hm. This seems a little overkill. There already are two options named
> CURLINFO_SIZE_UPLOAD and CURLINFO_SIZE_DOWNLOAD that returns those size
> fields, although separately so that you can decide for yourself which kind of
> "content-length" you want.
>
> Why would we need an option that just does a simple addition?
>

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-02-02