cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about using curl_easy_setopt CURL_INFILESIZE_LARGE

From: Rohan Desai <desai.p.rohan_at_gmail.com>
Date: Thu, 9 Feb 2012 10:05:11 -0800

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?

On Thu, Feb 9, 2012 at 2:53 AM, Dan Fandrich <dan_at_coneharvesters.com> wrote:

> On Wed, Feb 08, 2012 at 06:31:51PM -0800, Rohan Desai wrote:
> > For most requests, i provide a curl_off_t for file size. However for
> 0-byte
> > (empty) files i use:
> >
> > curl_easy_setopt(curl handle, CURLOPT_INFILESIZE_LARGE, 0L)
> >
> > This is causing my PUT to sometimes go out with huge Content-Length
> values. For
> > example:
> >
> > Content-Length: 163208757248
> >
> > Any ideas why this happens?
>
> CURLOPT_INFILESIZE_LARGE doesn't take a long parameter, but rather a
> curl_off_t parameter. Try casting your 0 to (curl_off_t) and see if
> that fixes it. That goes for all other *_LARGE options as well.
>
> >>> Dan
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

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