cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP keep alive connection

From: Loiseleur Michel <mloiseleur_at_linagora.com>
Date: Tue, 06 Nov 2007 00:06:14 +0100

Daniel Stenberg a écrit :
> On Mon, 5 Nov 2007, Michel Loiseleur wrote:
>
>> 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.
>
> Thanks for your efforts!
>
> This version of the patch still has several issues remaining. Some of
> them are easy to fix, some are harder:
>
> #1 - it uses a static variable in a silly way that won't work om subsequent
> transfers. Oh, and please don't use all upper case for a variable
> name,
> we do that only for defines/macros and enums.
>
> #2 - it still uses Curl_nbftpsendf() which may not send the whole data
>
> #3 - it doesn't deal with the server response, and if you do let it to this
> many times you'll end up sad
>
> #4 - it does this unconditionally and at a fixed interval, both are not
> really
> libcurl style. There should be a setting for interval and 0 (default)
> would mean never.
>
> #5 - I don't like how the progress code knows and uses ftp (protocol
> specific) stuff
>
> #6 - the code that's supposed to do this only if FTP is used is actually
> going
> to attempt this for just about all protocols (since that struct member
> is a union)
>
> #7 - why the mix with *int* index_timeout and *long* ftp_timeout_index ? On
> truly 64 bit architectures, int and long are not the same size and
> those
> lines will cause compiler warnings!
>
>
> #8 - your code doesn't care about in what state the FTP communication
> is, so if the server or network is *really* slow, the transfer may not
> have started yet but you're still involved in the pre-transfer
> command/response sequence and then an extra "NOOP" inserted will
> certainly mess upp things!

Waouh ! A lots of comments ! I'll see what I can do to fix those. My
main purpose was to show a little Poc, in order to accelerate this
features into the mainline, not anything else. Well, anyway, I'll try to
deal with all I can, but tomorrow.

Regards,

-- 
Michel
Received on 2007-11-06