From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 8 Jan 2007 10:08:49 -0000 Subject: [Cluster-devel] cluster/cman/daemon daemon.c Message-ID: <20070108100849.14486.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 */