socket/netconn recv: FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns)

This commit is contained in:
goldsimon 2017-11-17 21:22:53 +01:00
parent 2b309bd1ae
commit db3a4e3158

View File

@ -642,8 +642,8 @@ netconn_recv_data_tcp(struct netconn *conn, struct pbuf **new_buf, u8_t apiflags
#endif /* LWIP_TCP */
if (!sys_mbox_valid(&conn->recvmbox)) {
/* This happens when calling this function after receiving FIN */
return sys_mbox_valid(&conn->acceptmbox) ? ERR_CONN : ERR_CLSD;
/* This only happens when calling this function more than once *after* receiving FIN */
return ERR_CONN;
}
if (!(apiflags & NETCONN_NOAUTORCVD)) {