/[smeserver]/rpms/ipsvd/sme9/tcpsvd_keepalive.patch
ViewVC logotype

Annotation of /rpms/ipsvd/sme9/tcpsvd_keepalive.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Thu Apr 24 04:30:23 2014 UTC (10 years, 7 months ago) by wellsi
Branch: MAIN
CVS Tags: ipsvd-0_12_1-7_el6_sme, HEAD
Changes since 1.2: +16 -28 lines
* Wed Dec 25 2013 Charlie Brady <charlieb@e-smith.com> 0.12.1-06
- Add option to tcpsvd to set socket keepalive. Code provided by Chris Maltby.
  [SME: 8084]

1 wellsi 1.3 diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket_bind.c ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket_bind.c
2     --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket_bind.c 2006-02-04 11:16:48.000000000 -0800
3     +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket_bind.c 2014-04-23 20:54:30.000000000 -0700
4     @@ -32,2 +32,8 @@
5 charliebrady 1.1 }
6     }
7     +
8     +int socket_keepalive(int s)
9     +{
10     + int opt = 1;
11     + return setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&opt,sizeof opt);
12     +}
13 wellsi 1.3 diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket.h ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket.h
14     --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket.h 2006-02-04 11:16:48.000000000 -0800
15     +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket.h 2014-04-23 20:54:30.000000000 -0700
16     @@ -19,4 +19,5 @@
17 charliebrady 1.1
18     extern void socket_tryreservein(int,int);
19     +extern int socket_keepalive(int);
20    
21     #endif
22 wellsi 1.3 diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/tcpsvd.c ipsvd-0.12.1/net/ipsvd-0.12.1/src/tcpsvd.c
23     --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/tcpsvd.c 2006-02-04 11:16:47.000000000 -0800
24     +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/tcpsvd.c 2014-04-23 20:54:30.000000000 -0700
25     @@ -33,7 +33,7 @@
26 charliebrady 1.1
27     #ifdef SSLSVD
28     -#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog"
29     +#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog"
30     #else
31     -#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog"
32     +#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog"
33     #endif
34    
35 wellsi 1.3 @@ -55,4 +55,5 @@
36 charliebrady 1.1 unsigned long cmax =30;
37     unsigned long timeout =0;
38     +unsigned int keepalive =0;
39    
40     unsigned int ucspi =1;
41 wellsi 1.3 @@ -242,4 +243,6 @@
42 charliebrady 1.1 if ((fd_move(0, c) == -1) || (fd_copy(1, 0) == -1))
43     drop("unable to set filedescriptor");
44     + if (keepalive)
45     + socket_keepalive(0);
46     sig_uncatch(sig_term);
47     sig_uncatch(sig_pipe);
48 wellsi 1.3 @@ -272,8 +275,8 @@
49 charliebrady 1.1 #ifdef SSLSVD
50     while ((opt =getopt(argc, (const char **)argv,
51     - "c:C:i:x:u:l:Eb:hpt:vVU:/:Z:K:")) != opteof) {
52     + "c:C:i:x:u:l:Eb:hkpt:vVU:/:Z:K:")) != opteof) {
53     #else
54     while ((opt =getopt(argc, (const char **)argv,
55     - "c:C:i:x:u:l:Eb:hpt:vV")) != opteof) {
56     + "c:C:i:x:u:l:Eb:hpkt:vV")) != opteof) {
57     #endif
58     switch(opt) {
59 wellsi 1.3 @@ -298,4 +301,5 @@
60 charliebrady 1.1 case 'b': scan_ulong(optarg, &backlog); break;
61     case 'h': lookuphost =1; break;
62     + case 'k': keepalive =1; break;
63     case 'p': lookuphost =1; paranoid =1; break;
64     case 't': scan_ulong(optarg, &timeout); break;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed