cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP keep alive connection

From: Jamie Lokier <jamie_at_shareable.org>
Date: Mon, 5 Nov 2007 18:44:24 +0000

Patrick Monnerat wrote:
>
> Michel Loiseleur wrote:
>
> > In one sentence, this patch add a small feature to curl during ftp
> transfer : it sends "NOOP" message in order to keep connection alive.
>
> I think it must be an option, since this is not guaranteed by RFC959 to
> be properly processed by all servers.

Actually it is. From RFC959:

      In order to make FTP workable without needless error messages, the
      following minimum implementation is required for all servers:

         TYPE - ASCII Non-print
         MODE - Stream
         STRUCTURE - File, Record
         COMMANDS - USER, QUIT, PORT,
                    TYPE, MODE, STRU,
                      for the default values
                    RETR, STOR,
                    NOOP.

> If the goal is only to keep a firewall alive (but not the FTP server
> itself), I would prefer to use setsockopt(SO_KEEPALIVE), because only
> housekeeping data are exchanged (no TCP payload).

SO_KEEPALIVE isn't available on all platforms with TCP, though.

-- Jamie
Received on 2007-11-05