summaryrefslogtreecommitdiff
path: root/source4/cluster/ctdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-06 04:47:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:41 -0500
commit80d3b780e566dcb0a23fe4f1a89749acf4c3f470 (patch)
tree3e0bc266975a8c244bf2f4627d46e6979b918dd1 /source4/cluster/ctdb
parentef80bc34c1b0e0badc38f46069cf47048e0b23e8 (diff)
downloadsamba-80d3b780e566dcb0a23fe4f1a89749acf4c3f470.tar.gz
samba-80d3b780e566dcb0a23fe4f1a89749acf4c3f470.tar.bz2
samba-80d3b780e566dcb0a23fe4f1a89749acf4c3f470.zip
r21173: - keep the ctdb queue when reconnecting (this will need to be more
complex once we have code for changing the number of nodes) - fixed a ctdb/tcp bug in the handling of multiple packets waiting on a socket (This used to be commit faf9a1146cb5f33228a11e01b66cb3cbe18bd05d)
Diffstat (limited to 'source4/cluster/ctdb')
-rw-r--r--source4/cluster/ctdb/tcp/tcp_io.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source4/cluster/ctdb/tcp/tcp_io.c b/source4/cluster/ctdb/tcp/tcp_io.c
index 5385ad7f46..e59f6167ff 100644
--- a/source4/cluster/ctdb/tcp/tcp_io.c
+++ b/source4/cluster/ctdb/tcp/tcp_io.c
@@ -38,13 +38,6 @@ static void ctdb_tcp_node_dead(struct event_context *ev, struct timed_event *te,
struct ctdb_tcp_node *tnode = talloc_get_type(node->private,
struct ctdb_tcp_node);
- /* flush the queue */
- while (tnode->queue) {
- struct ctdb_tcp_packet *pkt = tnode->queue;
- DLIST_REMOVE(tnode->queue, pkt);
- talloc_free(pkt);
- }
-
/* start a new connect cycle to try to re-establish the
link */
talloc_free(tnode->fde);
@@ -68,6 +61,7 @@ void ctdb_tcp_node_write(struct event_context *ev, struct fd_event *fde,
always an error, as we have separate read and write
sockets. In future we may combine them, but for now it must
mean that the socket is dead, so we try to reconnect */
+ node->ctdb->upcalls->node_dead(node);
talloc_free(tnode->fde);
close(tnode->fd);
tnode->fd = -1;
@@ -170,10 +164,9 @@ void ctdb_tcp_incoming_read(struct event_context *ev, struct fd_event *fde,
in->ctdb->upcalls->recv_pkt(in->ctdb, d2, len);
data += len;
nread -= len;
- return;
}
- if (nread < 4 || *(uint32_t *)data > nread) {
+ if (nread > 0) {
/* we have only part of a packet */
if (data_base == data) {
in->partial.data = data;