apps/examples/usrsocktest: Add MSG_PEEK flag support
Do not decrement the recv_avail_bytes if MSG_PEEK flag is specified.
@@ -879,7 +879,12 @@ prepare:
{
char tmp = 'a' + i;
+ /* 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)
