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).

This commit is contained in:
fbernon 2007-05-23 17:53:35 +00:00
parent 953d783a3e
commit 0fe5dd8d43
2 changed files with 7 additions and 4 deletions

View File

@ -166,6 +166,11 @@ HISTORY
++ Bug fixes: ++ 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 2007-05-22 Simon Goldschmidt
* tcp.c: Fixed bug #1895 (tcp_bind not correct) by introducing a list of * tcp.c: Fixed bug #1895 (tcp_bind not correct) by introducing a list of
bound but unconnected (and non-listening) tcp_pcbs. bound but unconnected (and non-listening) tcp_pcbs.

View File

@ -496,12 +496,10 @@ netconn_recv(struct netconn *conn)
if (conn->callback) if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len); (*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
/* If we are closed, we indicate that we no longer wish to receive /* If we are closed, we indicate that we no longer wish to use the socket */
data by setting conn->recvmbox to SYS_MBOX_NULL. */
if (p == NULL) { if (p == NULL) {
memp_free(MEMP_NETBUF, buf); memp_free(MEMP_NETBUF, buf);
sys_mbox_free(conn->recvmbox); conn->err = ERR_CLSD;
conn->recvmbox = SYS_MBOX_NULL;
return NULL; return NULL;
} }