From 8cf7089c58dffb9cdbe9d1552add61e81405f721 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 30 Oct 2019 20:16:37 +0800 Subject: [PATCH] api_msg: Fixes for sock close from another thread Ref IDF-4794 --- src/api/api_msg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/api_msg.c b/src/api/api_msg.c index 6037ac99..b8464e29 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -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);