cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: FTP Response

From: Irvs <boreder_at_gmail.com>
Date: Mon, 1 Feb 2010 15:44:45 +0800

Thanks Daniel.

I have another question. I noticed that when an FTP server requires
authentication, the curl returns an equivalent CURLE_"needs-authentication"
error. While on the case of HTTP, curl just returns CURLE_OK, and you need
to parse the header response for any errors returned by the server.
Am I correct in saying that responses of FTP and HTTP are handled
differently by curl?

I am also faced with a problem when FTP requests are handled by an HTTP
proxy since in this scenario, HTTP response format are used instead of the
FTP response standard. I don't know how to identify if the response is from
a HTTP proxy server or from an FTP server. Or, it could be that when its
from an FTP server, an equivalent CURLE_error is returned and if its an from
an HTTP proxy CURLE_OK is returned and parse for error from the header
response?

-Irvs

On Fri, Jan 29, 2010 at 6:18 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 29 Jan 2010, Irvs wrote:
>
> Are all ftp responses from an FTP server mapped into a certain CURLE?
>>
>
> No. Different FTP errors are mapped into different libcurl errors. libcurl
> tries to provide more generic interface to file transfers, so that the same
> failure on a different protocol should lead to basically the same libcurl
> error (and thus curl exit code).
>
>
> Is CURLE same with the exit codes?
>>
>
> Yes, the CURLE* error codes libcurl returns is what curl will use as exit
> code.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
>
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-01