svn commit: samba r21173 - in branches/SAMBA_4_0/source/cluster/ctdb/tcp: .

tridge at samba.org tridge at samba.org
Tue Feb 6 04:47:44 GMT 2007


Author: tridge
Date: 2007-02-06 04:47:44 +0000 (Tue, 06 Feb 2007)
New Revision: 21173

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21173

Log:

- 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

Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_io.c


Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_io.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_io.c	2007-02-06 04:45:26 UTC (rev 21172)
+++ branches/SAMBA_4_0/source/cluster/ctdb/tcp/tcp_io.c	2007-02-06 04:47:44 UTC (rev 21173)
@@ -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