cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl doesn't handle responses from some old FTP servers

From: Alistair Campbell <adcingeo_at_hotmail.com>
Date: Fri, 11 Apr 2003 21:14:59 +1000

>From: Daniel Stenberg <daniel_at_haxx.se>
>Reply-To: curl-library_at_lists.sourceforge.net
>To: libcurl Mailing list <curl-library_at_lists.sourceforge.net>
>Subject: Re: libcurl doesn't handle responses from some old FTP servers
>Date: Fri, 11 Apr 2003 10:09:03 +0200 (CEST)
>
>On Fri, 4 Apr 2003, Alistair Campbell wrote:
>
> > One of the FTP servers our system interacts with is an old Netware 3.12
>FTP
> > server. This server returns a 200 Command OK reponse code for successful
> > completion of a CWD command, as opposed to the 250 File Command OK code
> > that libcurl (ftp.c) expects (and the RFC requires).
>
>Hi again Alistair,
>
>I'm just now committing this change, I trust it will solve your problem?
>
>diff -u -r1.174 ftp.c
>--- lib/ftp.c 9 Apr 2003 11:56:31 -0000 1.174
>+++ lib/ftp.c 11 Apr 2003 08:07:22 -0000
>@@ -726,7 +726,10 @@
> if (result)
> return result;
>
>- if (ftpcode != 250) {
>+ /* According to RFC959, CWD is supposed to return 250 on success, but
>+ there seem to be non-compliant FTP servers out there that return 200,
>+ so we accept any '2xy' code here. */
>+ if (ftpcode/100 != 2) {
> failf(conn->data, "Couldn't cd to %s", path);
> return CURLE_FTP_ACCESS_DENIED;
> }
>
>--
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
>

Hi Daniel,

Sounds good :)
I gather since no one spoke up with any objections then it shouldn't cause
any trouble.

Thanks,

Alistair.

_________________________________________________________________
MSN Instant Messenger now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp

-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
Received on 2003-04-11