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

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

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

Revision 1.2 by wellsi, Thu Apr 24 02:44:16 2014 UTC Revision 1.3 by wellsi, Thu Apr 24 04:30:23 2014 UTC
# Line 1  Line 1 
1  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/socket_bind.c net/ipsvd-0.12.1/src/socket_bind.c  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  --- net.old/ipsvd-0.12.1/src/socket_bind.c      2006-02-04 14:16:48.000000000 -0500  --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket_bind.c 2006-02-04 11:16:48.000000000 -0800
3  +++ net/ipsvd-0.12.1/src/socket_bind.c  2013-12-26 15:47:25.166952124 -0500  +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket_bind.c     2014-04-23 20:54:30.000000000 -0700
4  @@ -31,3 +31,9 @@  @@ -32,2 +32,8 @@
      size -= (size >> 5);  
5     }     }
6   }   }
7  +  +
# Line 11  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1 Line 10  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1
10  +  int opt = 1;  +  int opt = 1;
11  +  return setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&opt,sizeof opt);  +  return setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&opt,sizeof opt);
12  +}  +}
13  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/socket.h net/ipsvd-0.12.1/src/socket.h  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  --- net.old/ipsvd-0.12.1/src/socket.h   2006-02-04 14:16:48.000000000 -0500  --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket.h      2006-02-04 11:16:48.000000000 -0800
15  +++ net/ipsvd-0.12.1/src/socket.h       2013-12-26 15:47:25.167952137 -0500  +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket.h  2014-04-23 20:54:30.000000000 -0700
16  @@ -18,5 +18,6 @@  @@ -19,4 +19,5 @@
  extern int socket_remote4(int,char *,uint16 *);  
17    
18   extern void socket_tryreservein(int,int);   extern void socket_tryreservein(int,int);
19  +extern int socket_keepalive(int);  +extern int socket_keepalive(int);
20    
21   #endif   #endif
22  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/tcpsvd.c net/ipsvd-0.12.1/src/tcpsvd.c  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  --- net.old/ipsvd-0.12.1/src/tcpsvd.c   2006-02-04 14:16:47.000000000 -0500  --- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/tcpsvd.c      2006-02-04 11:16:47.000000000 -0800
24  +++ net/ipsvd-0.12.1/src/tcpsvd.c       2013-12-26 15:48:10.644538719 -0500  +++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/tcpsvd.c  2014-04-23 20:54:30.000000000 -0700
25  @@ -32,9 +32,9 @@  @@ -33,7 +33,7 @@
  #endif  
26    
27   #ifdef SSLSVD   #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"  -#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"
# Line 35  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1 Line 32  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1
32  +#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog"  +#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   #endif
34    
35   #define VERSION "$Id: tcpsvd.c,v 1.24 2006/02/03 19:30:24 pape Exp $"  @@ -55,4 +55,5 @@
 @@ -54,6 +54,7 @@  
  unsigned long cnum =0;  
36   unsigned long cmax =30;   unsigned long cmax =30;
37   unsigned long timeout =0;   unsigned long timeout =0;
38  +unsigned int keepalive =0;  +unsigned int keepalive =0;
39    
40   unsigned int ucspi =1;   unsigned int ucspi =1;
41   const char *instructs =0;  @@ -242,4 +243,6 @@
 @@ -241,6 +242,8 @@  
    else run =prog;  
42     if ((fd_move(0, c) == -1) || (fd_copy(1, 0) == -1))     if ((fd_move(0, c) == -1) || (fd_copy(1, 0) == -1))
43       drop("unable to set filedescriptor");       drop("unable to set filedescriptor");
44  +  if (keepalive)  +  if (keepalive)
45  +    socket_keepalive(0);  +    socket_keepalive(0);
46     sig_uncatch(sig_term);     sig_uncatch(sig_term);
47     sig_uncatch(sig_pipe);     sig_uncatch(sig_pipe);
48     sig_uncatch(sig_child);  @@ -272,8 +275,8 @@
 @@ -271,10 +274,10 @@  
   
49   #ifdef SSLSVD   #ifdef SSLSVD
50     while ((opt =getopt(argc, (const char **)argv,     while ((opt =getopt(argc, (const char **)argv,
51  -                      "c:C:i:x:u:l:Eb:hpt:vVU:/:Z:K:")) != opteof) {  -                      "c:C:i:x:u:l:Eb:hpt:vVU:/:Z:K:")) != opteof) {
# Line 65  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1 Line 56  diff -ru -I '\$Id:' net.old/ipsvd-0.12.1
56  +                      "c:C:i:x:u:l:Eb:hpkt:vV")) != opteof) {  +                      "c:C:i:x:u:l:Eb:hpkt:vV")) != opteof) {
57   #endif   #endif
58       switch(opt) {       switch(opt) {
59       case 'c': scan_ulong(optarg, &cmax); if (cmax < 1) usage(); break;  @@ -298,4 +301,5 @@
 @@ -297,6 +300,7 @@  
      case 'E': ucspi =0; break;  
60       case 'b': scan_ulong(optarg, &backlog); break;       case 'b': scan_ulong(optarg, &backlog); break;
61       case 'h': lookuphost =1; break;       case 'h': lookuphost =1; break;
62  +    case 'k': keepalive =1; break;  +    case 'k': keepalive =1; break;
63       case 'p': lookuphost =1; paranoid =1; break;       case 'p': lookuphost =1; paranoid =1; break;
64       case 't': scan_ulong(optarg, &timeout); break;       case 't': scan_ulong(optarg, &timeout); break;
      case 'v': ++verbose; break;  


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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