diff --git a/CHANGELOG b/CHANGELOG index 9408a17e..5a843a86 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -166,6 +166,11 @@ HISTORY ++ Bug fixes: + 2007-05-23 Frédéric Bernon + * api_lib.c: Fixed bug #5957 "Safe-thread problem inside netconn_recv" to return + an error code if it's impossible to fetch a pbuf on a TCP connection (and not + directly close the recvmbox). + 2007-05-22 Simon Goldschmidt * tcp.c: Fixed bug #1895 (tcp_bind not correct) by introducing a list of bound but unconnected (and non-listening) tcp_pcbs. diff --git a/src/api/api_lib.c b/src/api/api_lib.c index f7633ca1..cc032238 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -496,12 +496,10 @@ netconn_recv(struct netconn *conn) if (conn->callback) (*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len); - /* If we are closed, we indicate that we no longer wish to receive - data by setting conn->recvmbox to SYS_MBOX_NULL. */ + /* If we are closed, we indicate that we no longer wish to use the socket */ if (p == NULL) { memp_free(MEMP_NETBUF, buf); - sys_mbox_free(conn->recvmbox); - conn->recvmbox = SYS_MBOX_NULL; + conn->err = ERR_CLSD; return NULL; }