cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP keep alive connection

From: Michel Loiseleur <mloiseleur_at_linagora.com>
Date: Thu, 8 Nov 2007 12:20:40 +0100

Le Monday 05 November 2007 18:16:15 Michel Loiseleur, vous avez écrit :
> Hi all,
>
> After my post here :
> https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1826056&group_
>id=976
>
> I have reworked a little the patch, according to the comment. Feel free
> to improve it, hack it and especially, integrate it :).
>
> In one sentence, this patch add a small feature to curl during ftp
> transfer : it sends "NOOP" message in order to keep connection alive.
>
  Hi,
   
      Here's some news. As stated with some of you on this list, the "NOOP"
approach is really dangerous and cannot be applied in all cases, with all
servers.
      To the contrary, the SO_KEEPALIVE approach is working well. The patch is
nonintrusive and do not force us to add some more flags or more options on
compile time.
     It was validated on the whole set of my use cases. See the patch attached
for a sample code. It's maybe not the good place to set it, since I cannot
put the error message on the common log. But I do not know if it's better to
get the logger in the function or to set this socket option elsewhere, where
the logger is. So I'll leave it to one of the maintener.

     Here is the sysctl call :
$ sudo sysctl -w sysctl -w net.ipv4.tcp_keepalive_time=x
 
   With the small patch attached and x=60 for the sysctl call, we do not
encounter any more lost connection during long transfer.

    Feel free to integrate it (and keep me informed if it's the case ;)).

Thanks,

-- 
Loiseleur Michel / SLL
Groupe Linagora
27, rue de Berri / 75008 PARIS
Tel/Fax : 01 58 18 68 28 / 01 58 18 68 29
http://www.linagora.com/societe/nous_rejoindre/
"Ce n'est pas le logiciel qui est libre, c'est vous"

Received on 2007-11-08