mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 23:51:36 +08:00
Correct and error in recv() and recvfrom() return value
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4402 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -217,9 +217,17 @@ static int tftp_rcvack(int sd, uint8_t *packet, struct sockaddr_in *server,
|
||||
{
|
||||
/* Failed to receive a good packet */
|
||||
|
||||
if (nbytes >= 0)
|
||||
if (nbytes == 0)
|
||||
{
|
||||
ndbg("tftp_recvfrom short packet: %d bytes\n", nbytes);
|
||||
ndbg("Connection lost: %d bytes\n", nbytes);
|
||||
}
|
||||
else if (nbytes > 0)
|
||||
{
|
||||
ndbg("Short packet: %d bytes\n", nbytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbg("Recveid failure\n");
|
||||
}
|
||||
|
||||
/* Break out to bump up the retry count */
|
||||
|
||||
Reference in New Issue
Block a user