Commit 2bda19c6 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

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

parent 259879d1
...@@ -967,10 +967,15 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection, ...@@ -967,10 +967,15 @@ static int rpcrt4_conn_tcp_read(RpcConnection *Connection,
do do
{ {
int r = recv(tcpc->sock, (char *)buffer + bytes_read, count - bytes_read, 0); 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; bytes_read += r;
else if (errno != EAGAIN) else if (errno != EAGAIN)
{
WARN("recv() failed: %s\n", strerror(errno));
return -1; return -1;
}
else else
{ {
struct pollfd pfds[2]; struct pollfd pfds[2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment