First fix for "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT).

This commit is contained in:
fbernon 2007-08-27 10:08:53 +00:00
parent 5e7b7cba31
commit 54c1025ec0
4 changed files with 8 additions and 3 deletions

View File

@ -312,6 +312,11 @@ HISTORY
++ Bug fixes:
2007-08-27 Frédéric Bernon
* api.h, api_lib.c, api_msg.c: First fix for "bug #20900 : Potential crash error
problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state
and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT).
2007-08-24 Kieran Mansley
* inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy
compiler (Paradigm C++)

View File

@ -594,7 +594,7 @@ netconn_recv(struct netconn *conn)
if (conn->type == NETCONN_TCP) {
#if LWIP_TCP
if (conn->pcb.tcp->state == LISTEN) {
if (conn->state == NETCONN_LISTEN) {
conn->err = ERR_CONN;
return NULL;
}

View File

@ -676,6 +676,7 @@ do_listen(struct api_msg_msg *msg)
}
}
if (msg->conn->err == ERR_OK) {
msg->conn->state = NETCONN_LISTEN;
msg->conn->pcb.tcp = lpcb;
tcp_arg(msg->conn->pcb.tcp, msg->conn);
tcp_accept(msg->conn->pcb.tcp, accept_function);

View File

@ -74,8 +74,7 @@ enum netconn_type {
enum netconn_state {
NETCONN_NONE,
NETCONN_WRITE,
NETCONN_ACCEPT,
NETCONN_RECV,
NETCONN_LISTEN,
NETCONN_CONNECT,
NETCONN_CLOSE
};