socket/netconn recv: FIN should only be reported once
FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns). Before this change, ERR_CLSD was returned forever... This is the 2nd try. First try (commitebcae98ae6) was buggy in that it could drop the FIN if it was read together with data (reverted in commitebcae98ae6). This version fixes this by adding an apiflag and a netconn flag to keep track of this.
This commit is contained in:
@@ -173,9 +173,8 @@ static void test_sockets_allfunctions_basic_domain(int domain)
|
||||
ret = lwip_read(s2, buf, 1);
|
||||
fail_unless(ret == 0);
|
||||
|
||||
/* @todo: re-enable when this is working */
|
||||
/* ret = lwip_read(s2, buf, 1);
|
||||
fail_unless(ret == -1); */
|
||||
ret = lwip_read(s2, buf, 1);
|
||||
fail_unless(ret == -1);
|
||||
|
||||
ret = lwip_write(s2, "foo", 3);
|
||||
fail_unless(ret == 3);
|
||||
@@ -192,9 +191,8 @@ static void test_sockets_allfunctions_basic_domain(int domain)
|
||||
ret = lwip_read(s3, buf, 1);
|
||||
fail_unless(ret == 0);
|
||||
|
||||
/* @todo: re-enable when this is working */
|
||||
/* ret = lwip_read(s3, buf, 1);
|
||||
fail_unless(ret == -1); */
|
||||
ret = lwip_read(s3, buf, 1);
|
||||
fail_unless(ret == -1);
|
||||
|
||||
while(tcpip_thread_poll_one());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user