Re: FTP keep alive connection
Date: Mon, 5 Nov 2007 22:48:54 +0100 (CET)
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
#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!
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2007-11-05