cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about using curl_easy_setopt CURL_INFILESIZE_LARGE

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 10 Feb 2012 09:59:12 +0100

On Thu, Feb 09, 2012 at 10:05:11AM -0800, Rohan Desai wrote:
> I thought something like that. But after looking in the code it seems like it
> just assigns some curl_off_t variable the passed in value and later uses that
> variable to populate the content length. Shouldn't the internal curl_off_t get
> zeroed out regardless of whether the value passed to curl_easy_setopt is long
> or curl_off_t ? In other words, any insight into exactly why this is happening?

The code calling curl_easy_setopt stores a long to the stack, which in
your case is 4 bytes. But libcurl extracts a curl_off_t from the stack,
which in your case is 8 bytes. Those extra 4 bytes are garbage--whatever
value happens to be on the stack in that location.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-10