Fix broken MSG_PEEK on TCP sockets (post-2.0.3 bug)

MSG_PEEK on TCP sockets was broken since commit b71d4477ea
from 06.03.2017: recv hung in an endless loop and tcp_recved() was called for peeked data
(which would result in a too large window advertised).

Aded TCP MSG_PEEK to socket unit tests
This commit is contained in:
goldsimon
2017-11-18 13:34:20 +01:00
parent d99144eef1
commit f5c37c8cbb
2 changed files with 8 additions and 2 deletions

View File

@@ -161,6 +161,12 @@ static void test_sockets_allfunctions_basic_domain(int domain)
while(tcpip_thread_poll_one());
ret = lwip_recv(s2, buf, 3, MSG_PEEK);
fail_unless(ret == 3);
ret = lwip_recv(s2, buf, 3, MSG_PEEK);
fail_unless(ret == 3);
ret = lwip_read(s2, buf, 4);
fail_unless(ret == 4);