cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_perform with CURLOPT_NOBODY = 1 returns 0 when ftp file does not exist.

From: Carlos Alloatti <calloatti_at_gmail.com>
Date: Sun, 28 Sep 2008 13:25:34 -0300

When calling curl_easy_perform with CURLOPT_NOBODY set to 1, setting
CURLOPT_URL to a non-existing file in an FTP server, the return value
is 0.

I am using this to latter get the file size with
CURLINFO_CONTENT_LENGTH_DOWNLOAD.

The returned file size is -1 in this case, but maybe curl_easy_perform
should not return 0, but something else, like
CURLE_REMOTE_FILE_NOT_FOUND

Under the same circumstances, with CURLOPT_NOBODY set to 0, the return
value is 19, CURLE_FTP_COULDNT_RETR_FILE

Sorry I cannot provide repro code, I am actually wrapping libcurl in a
Visual FoxPro class, and I know the Visual FoxPro code will be useless
in this case.

-- 
Carlos Alloatti
Received on 2008-09-28