Changed error handling: ERR_MEM, ERR_BUF and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and sockets block most operations once they have seen a fatal error.

This commit is contained in:
goldsimon
2007-11-27 21:15:44 +00:00
parent b4741332e0
commit 03777ccb21
5 changed files with 34 additions and 27 deletions

View File

@@ -355,18 +355,21 @@ netconn_recv(struct netconn *conn)
if (conn->recvmbox == SYS_MBOX_NULL) {
if ((conn->recvmbox = sys_mbox_new()) == SYS_MBOX_NULL) {
/* @todo: should calling netconn_recv on a TCP listen conn be fatal?? */
/* TCP listen conn don't have a recvmbox! */
conn->err = ERR_CONN;
return NULL;
}
}
if (conn->err != ERR_OK) {
if (ERR_IS_FATAL(conn->err)) {
return NULL;
}
if (conn->type == NETCONN_TCP) {
#if LWIP_TCP
if (conn->state == NETCONN_LISTEN) {
/* @todo: should calling netconn_recv on a TCP listen conn be fatal?? */
conn->err = ERR_CONN;
return NULL;
}