summaryrefslogtreecommitdiffstats
path: root/ctdb/tcp
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-07 13:26:07 +1100
committerAndrew Tridgell <tridge@samba.org>2007-02-07 13:26:07 +1100
commit979ef2832ae1c65d636c78dd83c5261f97ce208a (patch)
tree8b9a8ee7f98ee4cdb1aff90422cd3fd06338ee2a /ctdb/tcp
parentc16b53025725828d5b3637ecdf1280dc87ee9305 (diff)
downloadsamba-979ef2832ae1c65d636c78dd83c5261f97ce208a.tar.gz
samba-979ef2832ae1c65d636c78dd83c5261f97ce208a.tar.xz
samba-979ef2832ae1c65d636c78dd83c5261f97ce208a.zip
merged from samba4 ctdb
(This used to be ctdb commit 677fd2a7758b743ea920d0b3adb85fbb3f1ff49e)
Diffstat (limited to 'ctdb/tcp')
-rw-r--r--ctdb/tcp/tcp_io.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index 5385ad7f46..e59f6167ff 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/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;