]> granicus.if.org Git - esp-idf/commitdiff
Close socket request will abort tcp write/connect
authorXiaXiaotian <xiaxiaotian@espressif.com>
Tue, 19 Dec 2017 07:20:50 +0000 (15:20 +0800)
committerXiaXiaotian <xiaxiaotian@espressif.com>
Tue, 19 Dec 2017 07:20:50 +0000 (15:20 +0800)
    When tcp write/connect is running, close socket request will abort
    it and continue to delete netconn and close tcp. Do not immediately
    return after aborting tcp write/connect. Otherwise, tcp close
    requeset will block and tcp write/connect will crash.

components/lwip/api/api_msg.c

index a3f21fb53c13452e3e072d0c375b2065c919ebec..2bc02c91e6d2bf6afe51f931877c636334f2ccdf 100755 (executable)
@@ -1085,12 +1085,6 @@ lwip_netconn_do_delconn(void *m)
   } else
 #endif /* LWIP_NETCONN_FULLDUPLEX */
   {
-    if (!(state != NETCONN_CONNECT || IN_NONBLOCKING_CONNECT(msg->conn))) {
-      msg->err = ERR_INPROGRESS;
-      NETCONN_SET_SAFE_ERR(msg->conn, ERR_INPROGRESS);
-      LWIP_DEBUGF(API_MSG_DEBUG, ("netconn error:ERR_INPROGRESS\n"));
-      return;
-    }
     /* Drain and delete mboxes */
     netconn_drain(msg->conn);