cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Keepalive - one step further

From: <autrelandes-curl_at_yahoo.fr>
Date: Thu, 3 Jan 2008 10:43:02 +0000 (GMT)

Hello, > I have written a patch against current CVS for adding the possibility to > change the tcp_keepalive_probes, tcp_keepalive_time and tcp_keepalive_intvl > on a per-socket basis in libcurl and in curl (it avoids to have to change > kernel parameters for every socket). > Thanks, but can you please elaborate on why you think libcurl needs to > have this ability rather than you just set these options in your app > using one of the existing callbacks libcurl already provides? Like > CURLOPT_SOCKOPTFUNCTION... Yes, sure. The parameters TCP_KEEPCNT, TCP_KEEPIDLE and TCP_INTVL are defined in <netinet/tcp.h>. This header is not available from src/main.c, while it is available from lib/connect.c. I just applied the same rules which are used for the use of TCP_NODELAY in curl : TCP_NODELAY is also in <netinet/tcp.h> ; a function, tcpnodelay, has been defined in lib/connect.c. Maybe the same include problem arises with the parameter IPPROTO_TCP (as one cannot use the SOL_SOCKET level for modifying the keepalive values ; see man 7 tcp and man 7 socket) which is defined in <netinet/in.h>, but I did not check. Eric LANDES _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr
Received on 2008-01-04