[Cluster-devel] cluster/cman/daemon daemon.c

pcaulfield at sourceware.org pcaulfield at sourceware.org
Mon Jan 8 10:07:53 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-08 10:07:52

Modified files:
	cman/daemon    : daemon.c 

Log message:
	If there are already queued messages for a client then don't send new ones
	out of order

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.32&r2=1.33

--- cluster/cman/daemon/daemon.c	2006/09/14 13:01:06	1.32
+++ cluster/cman/daemon/daemon.c	2007/01/08 10:07:52	1.33
@@ -66,7 +66,17 @@
 	int ret;
 
 	P_DAEMON("sending reply %x to fd %d\n", msg->command, con->fd);
-	ret = send(con->fd, (char *)msg, msg->length, MSG_DONTWAIT);
+
+	/* If there are already queued messages then don't send this one
+	   out of order */
+	if (!list_empty(&con->write_msgs)) {
+		ret = -1;
+		errno = EAGAIN;
+	}
+	else {
+		ret = send(con->fd, (char *)msg, msg->length, MSG_DONTWAIT);
+	}
+
 	if ((ret > 0 && ret != msg->length) ||
 	    (ret == -1 && errno == EAGAIN)) {
 		/* Queue it */




More information about the Cluster-devel mailing list