merge from ronnie
authorAndrew Tridgell <tridge@samba.org>
Thu, 18 Oct 2007 23:39:07 +0000 (09:39 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 18 Oct 2007 23:39:07 +0000 (09:39 +1000)
1  2 
tcp/tcp_init.c

diff --cc tcp/tcp_init.c
index f5d4e4c1d6b4a6d2d36792ab6569704bc4756242,98a4c493f2e3a8d51783fe545599e9557393e8fd..1b186c3f400ac2536e2aa370a4e885383be2ef17
@@@ -88,6 -88,28 +88,24 @@@ static int ctdb_tcp_start(struct ctdb_c
        return 0;
  }
  
 -      if (tnode->fd == -1) {
 -              close(tnode->fd);
 -              tnode->fd = -1;
 -      }
 -
+ /*
+   shutdown and try to restart a connection to a node after it has been
+   disconnected
+ */
+ static void ctdb_tcp_restart(struct ctdb_node *node)
+ {
+       struct ctdb_tcp_node *tnode = talloc_get_type(
+               node->private_data, struct ctdb_tcp_node);
+       DEBUG(0,("Tearing down connection to dead node :%d\n", node->pnn));
++      tnode->fd = -1;
+       ctdb_queue_set_fd(tnode->out_queue, -1);
+       event_add_timed(node->ctdb->ev, tnode, timeval_zero(), 
+                       ctdb_tcp_node_connect, node);
+ }
  
  /*
    shutdown the transport