Date: Thu, 16 Jun 2011 08:31:06 +0000 (UTC) From: Maxim Sobolev <sobomax@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r223143 - head/sbin/hastd Message-ID: <201106160831.p5G8V63X019608@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sobomax Date: Thu Jun 16 08:31:06 2011 New Revision: 223143 URL: http://svn.freebsd.org/changeset/base/223143 Log: Revert r222688. Requested by: Mikolaj Golub Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Thu Jun 16 07:27:13 2011 (r223142) +++ head/sbin/hastd/proto_common.c Thu Jun 16 08:31:06 2011 (r223143) @@ -194,8 +194,6 @@ int proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) { ssize_t done; - size_t total_done, recvsize; - unsigned char *dp; PJDLOG_ASSERT(sock >= 0); @@ -212,19 +210,9 @@ proto_common_recv(int sock, unsigned cha PJDLOG_ASSERT(data != NULL); PJDLOG_ASSERT(size > 0); - total_done = 0; - dp = data; do { - recvsize = size - total_done; - recvsize = recvsize < MAX_SEND_SIZE ? recvsize : MAX_SEND_SIZE; - done = recv(sock, dp, recvsize, MSG_WAITALL); - if (done == -1 && errno == EINTR) - continue; - if (done <= 0) - break; - total_done += done; - dp += done; - } while (total_done < size); + done = recv(sock, data, size, MSG_WAITALL); + } while (done == -1 && errno == EINTR); if (done == 0) { return (ENOTCONN); } else if (done < 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106160831.p5G8V63X019608>