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: Thu, 9 Feb 2012 11:53:13 +0100

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
Received on 2012-02-09