api_msg: Fixes for sock close from another thread

Ref IDF-4794
This commit is contained in:
xueyunfei
2019-10-30 20:16:37 +08:00
committed by David Cermak
parent 882716f729
commit 8cf7089c58
+3
View File
@@ -595,6 +595,9 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
tcp_err(pcb, NULL);
/* remove reference from to the pcb from this netconn */
newconn->pcb.tcp = NULL;
#if ESP_LWIP && LWIP_NETCONN_FULLDUPLEX
newconn->flags |= NETCONN_FLAG_MBOXINVALID;
#endif /* ESP_LWIP && LWIP_NETCONN_FULLDUPLEX */
/* no need to drain since we know the recvmbox is empty. */
sys_mbox_free(&newconn->recvmbox);
sys_mbox_set_invalid(&newconn->recvmbox);