Merge pull request #121 from plieven/fix_recv
socket: handle count == 0 in rpc_read_from_socketlibnfs-4.0.0-vitalif
commit
e466dc6b03
|
@ -249,6 +249,12 @@ static int rpc_read_from_socket(struct rpc_context *rpc)
|
|||
rpc_set_error(rpc, "Read from socket failed, errno:%d. Closing socket.", errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
/* remote side has closed the socket. Reconnect. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
rpc->inpos += count;
|
||||
|
||||
while (rpc->inpos >= 4) {
|
||||
|
|
Loading…
Reference in New Issue