Setting CURLOPT_INFILESIZE to -1 leads to error #2047

Closed
voitsik opened this Issue Nov 3, 2017 · 1 comment

Comments

Projects
None yet
2 participants

voitsik commented Nov 3, 2017

I did this

Call the following function:
curl_easy_setopt(curl, CURLOPT_INFILESIZE, (long)-1);
The man page explicitly states that the third argument of the function (filesize) may be set to '-1'.

I expected the following

Get return value CURLE_OK.

instead got the following

CURLE_BAD_FUNCTION_ARGUMENT

curl/libcurl version

curl 7.56.1 (x86_64-pc-linux-gnu) libcurl/7.56.1 OpenSSL/1.0.2l zlib/1.2.11
Release-Date: 2017-10-23
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS Largefile NTLM SSL libz TLS-SRP UnixSockets HTTPS-proxy

operating system

Gentoo Base System release 2.4.1

Notes

Previous version of curl (7.56.0) does not have this problem.

The problem was originally identified when using curlftpfs. After upgrading the system installation of curl to 7.56.1 it became impossible to upload files to FTP servers mounted via curlftpfs.

@bagder bagder closed this in 921bf1d Nov 3, 2017

Owner

bagder commented Nov 3, 2017

Thank you, fixed in git now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment