[Cluster-devel] cluster/cman/daemon daemon.c
pcaulfield at sourceware.org
pcaulfield at sourceware.org
Mon Jan 8 10:08:49 UTC 2007
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
--- cluster/cman/daemon/daemon.c 2006/09/14 13:01:06 1.32
+++ cluster/cman/daemon/daemon.c 2007/01/08 10:08:48 1.32.2.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 */
More information about the Cluster-devel
mailing list