gustavonihei commented on a change in pull request #3707:
URL: https://github.com/apache/incubator-nuttx/pull/3707#discussion_r631880604
##########
File path: fs/nfs/rpc_clnt.c
##########
@@ -371,13 +395,22 @@ static int rpcclnt_receive(FAR struct rpcclnt *rpc,
resplen = mark;
}
- error = psock_recv(&rpc->rc_so, reply, resplen, 0);
+repeat:
+ error = psock_recv(&rpc->rc_so, reply + offset, resplen, 0);
if (error < 0)
{
ferr("ERROR: psock_recv response failed: %d\n", error);
return error;
}
+ resplen -= error;
+ offset += error;
+
+ if (rpc->rc_sotype == SOCK_STREAM && resplen)
+ {
+ goto repeat;
+ }
Review comment:
According to the coding stardard, goto should only be used for exception
handling:
https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#goto
```suggestion
do {
error = psock_recv(&rpc->rc_so, reply + offset, resplen, 0);
if (error < 0)
{
ferr("ERROR: psock_recv response failed: %d\n", error);
return error;
}
resplen -= error;
offset += error;
} while (rpc->rc_sotype == SOCK_STREAM && resplen != 0);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]