Menu

#50 curl file size for uploads not set correctly on 64-bit

open
nobody
None
5
2009-10-25
2009-10-25
Anonymous
No

This is being set in curl as 4294967295, causing every flush to return an error:
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1);

Changing it to the following fixes it:
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, (curl_off_t)-1);

I suspect the "-1" is 64 bits in size, and curl is only using the lower 32 bits, whereas casting it to curl_off_t will use the correct size.

Discussion


Log in to post a comment.