mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-15 15:06:42 +00:00
Revert r222688.
Requested by: Mikolaj Golub
This commit is contained in:
parent
72d8b2903f
commit
e0455434b4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223143
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user