mirror of
https://github.com/apache/nuttx.git
synced 2026-05-13 10:38:40 +08:00
net/usrsock: Fix recv() couldn't peek data
Fix a bug that recv() couldn't peek receive data. recv() would be failed by previous recv() call with MSG_PEEK.
This commit is contained in:
@@ -424,6 +424,15 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
||||
*/
|
||||
|
||||
outaddrlen = state.valuelen_nontrunc;
|
||||
|
||||
/* If the MSG_PEEK flag is enabled, it will only peek
|
||||
* from the buffer, so remark the input as ready.
|
||||
*/
|
||||
|
||||
if (flags & MSG_PEEK)
|
||||
{
|
||||
conn->flags |= USRSOCK_EVENT_RECVFROM_AVAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user