]> granicus.if.org Git - curl/commitdiff
closesocket: call multi socket cb on close even with custom close
authorFrank Meier <frank.meier@ergon.ch>
Sun, 15 Mar 2015 12:24:26 +0000 (13:24 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 15 Mar 2015 12:26:03 +0000 (13:26 +0100)
In function Curl_closesocket() in connect.c the call to
Curl_multi_closed() was wrongly omitted if a socket close function
(CURLOPT_CLOSESOCKETFUNCTION) is registered.

That would lead to not removing the socket from the internal hash table
and not calling the multi socket callback appropriately.

Bug: http://curl.haxx.se/bug/view.cgi?id=1493

lib/connect.c

index 464d7fbac223846ccf428952c47a74d0f0b9aeea..aa4dbe0fe4269c93c787991b708486b6ce763a12 100644 (file)
@@ -1263,8 +1263,10 @@ int Curl_closesocket(struct connectdata *conn,
          accept, then we MUST NOT call the callback but clear the accepted
          status */
       conn->sock_accepted[SECONDARYSOCKET] = FALSE;
-    else
+    else {
+      Curl_multi_closed(conn, sock);
       return conn->fclosesocket(conn->closesocket_client, sock);
+    }
   }
 
   if(conn)