summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2011-06-16 08:31:06 +0000
committersobomax <sobomax@FreeBSD.org>2011-06-16 08:31:06 +0000
commit47a79e7f33b2a1b4ff9273b5da268287f7008ca4 (patch)
tree76fcedc6955469a54ba9e599a4a062598082d233 /sbin
parentb503814d5d2dba33742410540a7fb0ad0041325c (diff)
downloadFreeBSD-src-47a79e7f33b2a1b4ff9273b5da268287f7008ca4.zip
FreeBSD-src-47a79e7f33b2a1b4ff9273b5da268287f7008ca4.tar.gz
Revert r222688.
Requested by: Mikolaj Golub
Diffstat (limited to 'sbin')
-rw-r--r--sbin/hastd/proto_common.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sbin/hastd/proto_common.c b/sbin/hastd/proto_common.c
index 1f541da..183b4e4 100644
--- a/sbin/hastd/proto_common.c
+++ b/sbin/hastd/proto_common.c
@@ -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 char *data, size_t size, int *fdp)
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) {
OpenPOWER on IntegriCloud