[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[gftp] Correct use of ABOR



When gFTP wants to abort a transfer it closes the data connection, then
sends the ABOR command. This leaves gFTP in a confused state that causes
it to disconnect. I noticed this when writing my own FTP server, but
other ftp servers (even your own ftp.seul.org) do this too, and that's
the way any RFC compliant ftp server should behave.

Here is an example, downloading and aborting from ftp.seul.org:

RETR /pub/gftp/gftp-2.0.14.tar.gz
150 Opening BINARY mode data connection for /pub/gftp/gftp-2.0.14.tar.gz (1136930 bytes).
Stopping the transfer on host ftp.seul.org
ABOR
426 Data connection: Transport endpoint is not connected.
Disconnecting from site ftp.seul.org

The correct way, as clearly stated in section 3.2 and 4.1.3 of RFC959,
is to send the ABOR command and wait for the server to close the data
connection. The data connection should always be closed by the server,
except when STORing where the close means EOF.

If, for some reason, you really want to close the data connection
yourself, just don't send ABOR afterward. The close will do the same
thing as ABOR.

If you're stopping the transfer in this non-standard way because some
FTP servers don't seem to react on ABOR, try to read the last part of
section 4.1.3 in the RFC about "special action". That is what lftp does,
and it works with all servers.

-- 
Jonas Jensen <jbj@knef.dk>