rpcrt4: Return an error from rpcrt4_conn_tcp_read if recv returns 0.

This commit is contained in:
Rob Shearman 2007-12-16 12:07:01 +00:00 committed by Alexandre Julliard
parent 259879d1f5
commit 2bda19c6b0
1 changed files with 6 additions and 1 deletions

View File

@ -967,10 +967,15 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection,
do
{
int r = recv(tcpc->sock, (char *)buffer + bytes_read, count - bytes_read, 0);
if (r >= 0)
if (!r)
return -1;
else if (r > 0)
bytes_read += r;
else if (errno != EAGAIN)
{
WARN("recv() failed: %s\n", strerror(errno));
return -1;
}
else
{
struct pollfd pfds[2];