mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
net/local: Fix receive data size calculation for local_recvmsg
In psock_dgram_recvfrom function, fix code logic.
This commit is contained in:
@@ -289,7 +289,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
{
|
{
|
||||||
/* Read 32 bytes into the bit bucket */
|
/* Read 32 bytes into the bit bucket */
|
||||||
|
|
||||||
readlen = MIN(remaining, 32);
|
tmplen = MIN(remaining, 32);
|
||||||
ret = psock_fifo_read(psock, bitbucket, &tmplen, false);
|
ret = psock_fifo_read(psock, bitbucket, &tmplen, false);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@@ -302,6 +302,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
|
|
||||||
DEBUGASSERT(tmplen <= remaining);
|
DEBUGASSERT(tmplen <= remaining);
|
||||||
remaining -= tmplen;
|
remaining -= tmplen;
|
||||||
|
readlen += tmplen;
|
||||||
}
|
}
|
||||||
while (remaining > 0);
|
while (remaining > 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user