samba-cvs.cvs
[Top] [All Lists]

Rev 307: enable TCP keepalives in http://samba.org/~tridge/ctdb

Subject: Rev 307: enable TCP keepalives in http://samba.org/~tridge/ctdb
From:
Date: Tue, 15 May 2007 18:40:57 +1000
------------------------------------------------------------
revno: 307
revision-id: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
parent: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
committer: Andrew Tridgell <tridge@xxxxxxxxx>
branch nick: tridge
timestamp: Tue 2007-05-15 18:40:56 +1000
message:
  enable TCP keepalives
modified:
  tcp/tcp_connect.c              tcp_connect.c-20061128004937-x70q1cu5xzg5g2tm-1
=== modified file 'tcp/tcp_connect.c'
--- a/tcp/tcp_connect.c 2007-05-15 04:08:58 +0000
+++ b/tcp/tcp_connect.c 2007-05-15 08:40:56 +0000
@@ -82,6 +82,7 @@
        talloc_free(fde);
        
         setsockopt(tnode->fd,IPPROTO_TCP,TCP_NODELAY,(char *)&one,sizeof(one));
+        setsockopt(tnode->fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(one));
 
        ctdb_queue_set_fd(tnode->queue, tnode->fd);
 
@@ -180,6 +181,7 @@
        socklen_t len;
        int fd;
        struct ctdb_incoming *in;
+       int one = 1;
 
        ctdb = talloc_get_type(private_data, struct ctdb_context);
        ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp);
@@ -194,6 +196,8 @@
 
        set_nonblocking(in->fd);
 
+        setsockopt(in->fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(one));
+
        in->queue = ctdb_queue_setup(ctdb, in, in->fd, CTDB_TCP_ALIGNMENT, 
                                     ctdb_tcp_read_cb, in);
 }

<Prev in Thread] Current Thread [Next in Thread>
  • Rev 307: enable TCP keepalives in http://samba.org/~tridge/ctdb, tridge <=