mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
apps/examples/usrsocktest: Add MSG_PEEK flag support
Do not decrement the recv_avail_bytes if MSG_PEEK flag is specified.
This commit is contained in:
parent
63a5ddcc7c
commit
4bd506b7f5
1 changed files with 6 additions and 1 deletions
|
|
@ -879,7 +879,12 @@ prepare:
|
|||
{
|
||||
char tmp = 'a' + i;
|
||||
|
||||
tsock->recv_avail_bytes--;
|
||||
/* Check if MSG_PEEK flag is specified. */
|
||||
|
||||
if ((req->flags & MSG_PEEK) != MSG_PEEK)
|
||||
{
|
||||
tsock->recv_avail_bytes--;
|
||||
}
|
||||
|
||||
wlen = write(fd, &tmp, 1);
|
||||
if (wlen < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue