cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 4 Apr 2003 15:16:08 +0200 (CEST)

On Fri, 4 Apr 2003, Alistair Campbell wrote:

> if (ftpcode != 250 && ftpcode != 200) {
> failf(conn->data, "Couldn't cd to %s", path);
> return CURLE_FTP_ACCESS_DENIED;
> }
>
> I realise now that the FTP server we are accessing is in the wrong, but I
> thought I'd post this anyway to see if anyone has any ideas or opinions on
> whether cURL should be a bit more tolerant (and less compliant??) or
> whether old FTP servers deserve the hassle they created for them selves...
> :)

Well, since all 2xx responses from an FTP server is meant to be positive, I
guess we could perhaps make the check even more generic like this:

 if (ftpcode/100 != 2) {
   failf(conn->data, "Couldn't cd to %s", path);
   return CURLE_FTP_ACCESS_DENIED;
 }

I've given this a thought and I can't see that we're losing anything major by
doing this "hack". Good servers will continue to "just work" and this kind of
weird servers will also be supported.

Anyone with a different opinion?

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-04-04