Skip to contentSkip to conversation

cluster/cman/daemon daemon.c

Cluster-devel [email protected] 1 participant 1 message Jan 8, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: pcaulfield at sourceware.org 2007-01-08 10:08:48

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&only_with_tag=RHEL5&r1=1.32&r2=1.32.2.1

cman/daemon/daemon.c +11 -1
@@ -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 */