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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to