cURL / Mailing Lists / curl-library / Single Mail

curl-library

Reusing connection after failed FTP QUOTE command

From: Scott Barrett <scott_barrett_at_partech.com>
Date: Tue, 08 Apr 2008 10:21:55 -0400

Dan, et. al.,

What are your thoughts on permitting a cURL connection to be reused after a
failed FTP QUOTE command?

I see (in the ftp_done function in ftp.c) that a connection is permitted to be
reused in the following cases:

   CURLE_BAD_DOWNLOAD_RESUME
   CURLE_FTP_WEIRD_PASV_REPLY
   CURLE_FTP_PORT_FAILED
   CURLE_FTP_COULDNT_SET_TYPE
   CURLE_FTP_COULDNT_RETR_FILE
   CURLE_UPLOAD_FAILED
   CURLE_REMOTE_ACCESS_DENIED
   CURLE_FILESIZE_EXCEEDED

I'd like to see the same behavior when the status is CURLE_QUOTE_ERROR in order
to avoid the need to establish a new connection and reauthenticate, etc..

The scenario I'm dealing with is the old FTP bugaboo, parsing results of the
LIST command in order to perform recursive operations (e.g., put or rmdir) or
provide parsed listing results back to client software. After getting the data
back and parsing it, it is sometimes desirable to perform other operations on
the results, such as MDTM or SIZE. When the target of such a quoted command is
a symbolic link, the command will fail if the link refers to a directory. The
failure is fine and useful information, but I'd like to be able to reuse the
connection for subsequent curl_easy_perform calls.

This is really only a performance issue (avoiding reconnection/reauthentication)
in my eyes, but if you don't think that this would be a really bad idea, I will
experiment and report back.

- Scott
Received on 2008-04-08