From: Andrew Tridgell Date: Thu, 18 Oct 2007 23:39:07 +0000 (+1000) Subject: merge from ronnie X-Git-Tag: tevent-0.9.20~348^2~2370 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f47f758fe86dcaa77c8d6fdc67553a0f0dbfe63a;p=thirdparty%2Fsamba.git merge from ronnie (This used to be ctdb commit d444fdc7782496abe4b27003b647ac49fb52e6be) --- f47f758fe86dcaa77c8d6fdc67553a0f0dbfe63a diff --cc ctdb/tcp/tcp_init.c index f5d4e4c1d6b,98a4c493f2e..1b186c3f400 --- a/ctdb/tcp/tcp_init.c +++ b/ctdb/tcp/tcp_init.c @@@ -88,6 -88,28 +88,24 @@@ static int ctdb_tcp_start(struct ctdb_c return 0; } + /* + 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)); + - if (tnode->fd == -1) { - close(tnode->fd); - tnode->fd = -1; - } - ++ 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