cluster/cman/daemon daemon.c
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
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 */