Rev 53: merged from samba4 ctdb in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Feb 7 02:26:07 GMT 2007


------------------------------------------------------------
revno: 53
revision-id: tridge at samba.org-20070207022607-0nx0fvt0aagc5pqx
parent: tridge at samba.org-20070129113006-nh3cfnyd3g3zuxra
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-02-07 13:26:07 +1100
message:
  merged from samba4 ctdb
modified:
  common/ctdb.c                  ctdb.c-20061127094323-t50f58d65iaao5of-2
  tcp/tcp_io.c                   tcp_io.c-20061128004937-x70q1cu5xzg5g2tm-3
=== modified file 'common/ctdb.c'
--- a/common/ctdb.c	2007-01-23 00:38:45 +0000
+++ b/common/ctdb.c	2007-02-07 02:26:07 +0000
@@ -175,6 +175,7 @@
 static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t length)
 {
 	struct ctdb_req_header *hdr;
+
 	if (length < sizeof(*hdr)) {
 		ctdb_set_error(ctdb, "Bad packet length %d\n", length);
 		return;
@@ -229,7 +230,7 @@
 }
 
 /*
-  called by the transport layer when a node is dead
+  called by the transport layer when a node is connected
 */
 static void ctdb_node_connected(struct ctdb_node *node)
 {

=== modified file 'tcp/tcp_io.c'
--- a/tcp/tcp_io.c	2007-01-23 00:38:45 +0000
+++ b/tcp/tcp_io.c	2007-02-07 02:26:07 +0000
@@ -38,13 +38,6 @@
 	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 @@
 		   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 @@
 		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;



More information about the samba-cvs mailing list