Fixed bug #28651 (tcp_connect: no callbacks called if tcp_enqueue fails) both in raw- and netconn-API

This commit is contained in:
goldsimon
2010-01-21 18:43:37 +00:00
parent 60696a8485
commit 82318c0ef1
3 changed files with 29 additions and 19 deletions

View File

@@ -882,13 +882,18 @@ do_connect(struct api_msg_msg *msg)
#endif /* LWIP_UDP */
#if LWIP_TCP
case NETCONN_TCP:
msg->conn->state = NETCONN_CONNECT;
msg->conn->current_msg = msg;
setup_tcp(msg->conn);
msg->err = tcp_connect(msg->conn->pcb.tcp, msg->msg.bc.ipaddr, msg->msg.bc.port,
do_connected);
/* sys_sem_signal() is called from do_connected (or err_tcp()),
* when the connection is established! */
if (msg->err == ERR_OK) {
msg->conn->state = NETCONN_CONNECT;
msg->conn->current_msg = msg;
} else {
/* tcp_connect failed, so do_connected will not be called: return now */
sys_sem_signal(msg->conn->op_completed);
}
break;
#endif /* LWIP_TCP */
default: