lwip: init lwip error code
Init the error code to ERR_OK when call tcpip_apimsg
This commit is contained in:
parent
6ff5c32ae5
commit
e2d077cea1
|
@ -75,10 +75,11 @@ static err_t netconn_close_shutdown(struct netconn *conn, u8_t how);
|
||||||
static err_t
|
static err_t
|
||||||
tcpip_apimsg(struct api_msg *apimsg)
|
tcpip_apimsg(struct api_msg *apimsg)
|
||||||
{
|
{
|
||||||
#ifdef LWIP_DEBUG
|
#if LWIP_DEBUG
|
||||||
/* catch functions that don't set err */
|
/* catch functions that don't set err */
|
||||||
apimsg->msg.err = ERR_VAL;
|
apimsg->msg.err = ERR_VAL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
#if LWIP_NETCONN_SEM_PER_THREAD
|
||||||
apimsg->msg.op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET();
|
apimsg->msg.op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||||
LWIP_ASSERT("netconn semaphore not initialized",
|
LWIP_ASSERT("netconn semaphore not initialized",
|
||||||
|
|
|
@ -1008,6 +1008,9 @@ lwip_netconn_do_delconn(void *m)
|
||||||
enum netconn_state state = msg->conn->state;
|
enum netconn_state state = msg->conn->state;
|
||||||
LWIP_ASSERT("netconn state error", /* this only happens for TCP netconns */
|
LWIP_ASSERT("netconn state error", /* this only happens for TCP netconns */
|
||||||
(state == NETCONN_NONE) || (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP));
|
(state == NETCONN_NONE) || (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP));
|
||||||
|
|
||||||
|
msg->err = ERR_OK;
|
||||||
|
|
||||||
#if LWIP_NETCONN_FULLDUPLEX
|
#if LWIP_NETCONN_FULLDUPLEX
|
||||||
/* In full duplex mode, blocking write/connect is aborted with ERR_CLSD */
|
/* In full duplex mode, blocking write/connect is aborted with ERR_CLSD */
|
||||||
if (state != NETCONN_NONE) {
|
if (state != NETCONN_NONE) {
|
||||||
|
@ -1022,6 +1025,7 @@ lwip_netconn_do_delconn(void *m)
|
||||||
msg->conn->write_offset = 0;
|
msg->conn->write_offset = 0;
|
||||||
msg->conn->state = NETCONN_NONE;
|
msg->conn->state = NETCONN_NONE;
|
||||||
NETCONN_SET_SAFE_ERR(msg->conn, ERR_CLSD);
|
NETCONN_SET_SAFE_ERR(msg->conn, ERR_CLSD);
|
||||||
|
msg->err = ERR_INPROGRESS;
|
||||||
sys_sem_signal(op_completed_sem);
|
sys_sem_signal(op_completed_sem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue