]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Fixed bug #28865 (Cannot close socket/netconn in non-blocking connect)
authorgoldsimon <goldsimon>
Fri, 12 Feb 2010 15:21:37 +0000 (15:21 +0000)
committergoldsimon <goldsimon>
Fri, 12 Feb 2010 15:21:37 +0000 (15:21 +0000)
CHANGELOG
src/api/api_msg.c

index 4b76efd5ba619d60724d614ef30e84a4f9ab62f7..0c45359754fc2cb56755915527daa033034765c8 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -110,6 +110,10 @@ HISTORY
 
   ++ Bugfixes:
 
+  2010-02-12: Simon Goldschmidt/Stephane Lesage
+  * api_msg.c: Fixed bug #28865 (Cannot close socket/netconn in non-blocking
+    connect)
+
   2010-02-12: Simon Goldschmidt
   * mem.h: Fixed bug #28866 (mem_realloc function defined in mem.h)
 
index 4e394a71f4cae7fe49277da18c1f72b4f2754e3a..7f44352a360c09f938a3ad0c2ae46e9edcaf125a 100644 (file)
@@ -762,11 +762,15 @@ void
 do_delconn(struct api_msg_msg *msg)
 {
   /* @todo TCP: abort running write/connect? */
-  if ((msg->conn->state != NETCONN_NONE) && (msg->conn->state != NETCONN_LISTEN)) {
+ if ((msg->conn->state != NETCONN_NONE) &&
+     (msg->conn->state != NETCONN_LISTEN) &&
+     (msg->conn->state != NETCONN_CONNECT)) {
     /* this only happens for TCP netconns */
     LWIP_ASSERT("msg->conn->type == NETCONN_TCP", msg->conn->type == NETCONN_TCP);
     msg->err = ERR_INPROGRESS;
   } else {
+    LWIP_ASSERT("blocking connect in progress",
+      (msg->conn->state != NETCONN_CONNECT) || IN_NONBLOCKING_CONNECT(msg->conn));
     /* Drain and delete mboxes */
     netconn_drain(msg->conn);