cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 11 Jan 2008 15:42:47 +0100 (CET)

On Tue, 8 Jan 2008, autrelandes-curl_at_yahoo.fr wrote:

> > 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.

Just the docs/curl.1 file, the hugehelp is generated from that.

> 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...).

I think --tcp-keep-idle should imply --tcp-keep-intvl to the same value. So
that you set them to the same value with only one command line option for it.

> For --tcp-keep-cnt, I added it for sake of completeness, but I'm not sure
> whether someone will find it useful.

I say let's don't include that until we (== someone) actually find use for it.

> 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).

Let's do it like this: if the set_so_keepalive() function fails to set
KEEPALIVE then you won't have to even try to set the TCP_KEEP* options, but if
it does succeeds with the KEEPALIVE but fails with the TCP_KEEP* we should
probably output a warning.

BTW, set_so_keepalive is then also better renamed to sockoptcallback or
similar.

> According to what you think is best, I can provide a new patch

Thanks!

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-01-11