From 030ffdee82e915065ac1ceb949d443fd15626fe9 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Mon, 5 Feb 2018 13:50:16 -0600 Subject: [PATCH] sockets: remove ERR_CLSD case after data receive With the changes introduced in b1b62751105d608d57249462d6ac5acbb809dd54 it's no longer possible to get ERR_CLSD from netconn_recv_tcp_pbuf_flags after we've received data because of the NETCONN_NOFIN flag, so remove handling for this case. Further the NETCONN_EVT_RCVPLUS stays active in netconn_recv_data_tcp when the NETCONN_NOFIN flag is used --- src/api/sockets.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 9469c2bf..d8dc8327 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -893,14 +893,6 @@ lwip_recv_tcp(struct lwip_sock *sock, void *mem, size_t len, int flags) if (recvd > 0) { /* already received data, return that (this trusts in getting the same error from netconn layer again next time netconn_recv is called) */ - if (err == ERR_CLSD) { - /* closed but already received data, ensure select gets the FIN, too */ - if (sock->conn->callback != NULL) { - LOCK_TCPIP_CORE(); - sock->conn->callback(sock->conn, NETCONN_EVT_RCVPLUS, 0); - UNLOCK_TCPIP_CORE(); - } - } goto lwip_recv_tcp_done; } /* We should really do some error checking here. */