summaryrefslogtreecommitdiff
path: root/ctdb/tcp
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-12-01 15:45:24 +1100
committerAndrew Tridgell <tridge@samba.org>2006-12-01 15:45:24 +1100
commitec5d2ddd8e860de584fb572bdb46e58422931010 (patch)
treeb422fe1b5cf478af1b129c241774987da9123107 /ctdb/tcp
parent7e21f51b0592ca3ccd858f2c67d314fe28222d02 (diff)
downloadsamba-ec5d2ddd8e860de584fb572bdb46e58422931010.tar.gz
- added ctdb_set_flags() call
- added --self-connect option to ctdb_test, allowing testing when a node connects to itself. not as efficient as local bypass, but very useful for testing purposes (easier to work with 1 task in gdb than 2) - split the ctdb_call() into an async triple, in the style of Samba4 async functions. So we now have ctdb_call_send(), ctdb_call_recv() and ctdb_call(). - added the main ctdb_call protocol logic. No error checking yet, but seems to work for simple cases - ensure we initialise the length argument to getsockopt() (This used to be ctdb commit 95fad717ef5ab93be3603aa11d2878876fe868d3)
Diffstat (limited to 'ctdb/tcp')
-rw-r--r--ctdb/tcp/tcp_connect.c2
-rw-r--r--ctdb/tcp/tcp_init.c3
-rw-r--r--ctdb/tcp/tcp_io.c2
3 files changed, 3 insertions, 4 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index c7e361f9ca9..9fc322fde5b 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -44,7 +44,7 @@ static void ctdb_node_connect_write(struct event_context *ev, struct fd_event *f
struct ctdb_tcp_node);
struct ctdb_context *ctdb = node->ctdb;
int error = 0;
- socklen_t len;
+ socklen_t len = sizeof(error);
if (getsockopt(tnode->fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0 ||
error != 0) {
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index 39ecec4dbdd..b3378677035 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -39,7 +39,8 @@ int ctdb_tcp_start(struct ctdb_context *ctdb)
next event loop */
for (i=0;i<ctdb->num_nodes;i++) {
struct ctdb_node *node = *(ctdb->nodes + i);
- if (ctdb_same_address(&ctdb->address, &node->address)) continue;
+ if (!(ctdb->flags & CTDB_FLAG_SELF_CONNECT) &&
+ ctdb_same_address(&ctdb->address, &node->address)) continue;
event_add_timed(ctdb->ev, node, timeval_zero(),
ctdb_tcp_node_connect, node);
}
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index d6bc2db83e4..67a6bc4b3b4 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -140,8 +140,6 @@ void ctdb_tcp_incoming_read(struct event_context *ev, struct fd_event *fde,
/* tell the ctdb layer above that we have a packet */
in->ctdb->upcalls->recv_pkt(in->ctdb, data, num_ready);
-
- talloc_free(data);
}
/*