curl-library
RE: State of things for release?
Date: Thu, 31 Jul 2008 15:17:41 +0000
> Dan Fandrich wrote:
>
> > Simply put, do a complete ftp transaction with CURLOPT_NOBODY set to 1 to
> > check the existence of the file, check the error code, then do a new one
> > (with the same handle) with CURLOPT_NOBODY set to 0 to actually transfer
> > the file.
>
>
> I just tried it here, and it looks like CURLOPT_NOBODY
> returns CURLE_OK even if the file doesn't exist, even
> when CURLOPT_FAILONERROR is set. I also tried testing
> the CURLINFO_RESPONSE_CODE and I am getting 350 in
> either case, libcurl still sends REST even after a 550
> response to SIZE. This was just a quick test, maybe I got
> something wrong:
>
>
> #include <curl/curl.h>
>
> int main(int argc, char*argv[])
> {
> CURL*curl=curl_easy_init();
> int rv;
> long resp;
> curl_easy_setopt(curl,CURLOPT_URL, argv[1]);
> curl_easy_setopt(curl,CURLOPT_NOBODY, 1);
> curl_easy_setopt(curl,CURLOPT_VERBOSE, 1);
> curl_easy_setopt(curl,CURLOPT_FAILONERROR, 1);
> rv=curl_easy_perform(curl);
> curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE,&resp);
> printf("rv=%d resp=%d\n", rv, resp);
> curl_easy_setopt(curl,CURLOPT_UPLOAD, 1);
> curl_easy_setopt(curl,CURLOPT_NOBODY, 0);
> rv=curl_easy_perform(curl);
> }
yeah this return always for me 350 code too
with/without FAILONERROR
with/without file exist
i still think a CURLOPT_FTPOVERWRITE define will be usefull
_________________________________________________________________
Instale a Barra de Ferramentas com Desktop Search e ganhe EMOTICONS para o Messenger! É GRÁTIS!
http://www.msn.com.br/emoticonpack
Received on 2008-07-31