mirror of
https://github.com/apache/nuttx.git
synced 2026-08-09 14:35:08 +00: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:
parent
4ea94c67b1
commit
8f39b20488
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue