cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re : --tcp-keep* options (was Re: [PATCH] SOCKS4a support)

From: <autrelandes-curl_at_yahoo.fr>
Date: Tue, 8 Jan 2008 18:31:01 +0000 (GMT)

Hi, > Thanks, but I don't think the question of keep-alive or no-keep-alive is > strictly related to the addition of these --tcp-keep* options so we are better > off discussing and dealing with them separately. OK. > I'd prefer if failing to set these options still return zero as I don't > consider problems with these options fatal. I agree. > I will also appreciate getting a > man page update for the three new options. No problem. I presume it means to change src/hugehelp.c and docs/curl.1 files. > Do you really think all three > options are necessary? Have you actually found a use-case where you need to > tweak all of them? I personnaly only want to use the --tcp-keep-idle option. I think --tcp-keep-intvl option is useless on Linux, but may be useful on others OS, e.g. Windows where the default is 1 second which is quite short (but the current patch does not apply to Windows...). For --tcp-keep-cnt, I added it for sake of completeness, but I'm not sure whether someone will find it useful. > Finally, I'm thinking about the problem with non-TCP connections and that this > callback will be called for them as well. Can't we assume that these TCP_KEEP* > options all work or none works? I mean, there's no need to output all three > warnings for TFTP transfers... Or why not do this: we first do a getsockopt() > on the socket to see if SO_KEEPALIVE is enabled - and only then try to set > these options? Then we'll only see a single warning on TFTP transfers... It should indeed be to try to set the TCP_KEEP* options only if SO_KEEPALIVE is enabled. It was previously the case with the return 1, but now it is just a matter of adding a else. So, one would get either a) a warning about SO_KEEPALIVE (e.g. for TFTP) or b) 1, 2 or 3 warnings for each TCP_KEEP* (for those who _really_ want to use those the 1, 2 or 3 TCP_KEEP* options but fail for some reason ; at this point, I think it is not useful to globalize the warnings) or c) no warning (everything is fine). According to what you think is best, I can provide a new patch with an updated doc, which works with the --no-keep-alive option, includes the --tcp-keep-idle option and possibly the one or two additional options, and gives only warnings in case of failure (and only one warning for TFTP and alike transfers). Eric LANDES _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr
Received on 2008-01-08