]> granicus.if.org Git - curl/commitdiff
multi: call detach_connection before Curl_disconnect
authorGergely Nagy <ngg@tresorit.com>
Thu, 25 Jul 2019 08:26:16 +0000 (10:26 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Jul 2019 16:06:42 +0000 (18:06 +0200)
Curl_disconnect bails out if conn->easyq is not empty, detach_connection
needs to be called first to remove the current easy from the queue.

Fixes #4144
Closes #4151

lib/multi.c

index 2b6b1bc52219703cf243b4593e22856ee96925a2..a9fd1f8b6290c40536b708233601638982690224 100644 (file)
@@ -2012,13 +2012,15 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
           if(stream_error) {
             /* Don't attempt to send data over a connection that timed out */
             bool dead_connection = result == CURLE_OPERATION_TIMEDOUT;
-            /* disconnect properly */
-            Curl_disconnect(data, data->conn, dead_connection);
+            struct connectdata *conn = data->conn;
 
             /* This is where we make sure that the conn pointer is reset.
                We don't have to do this in every case block above where a
                failure is detected */
             detach_connnection(data);
+
+            /* disconnect properly */
+            Curl_disconnect(data, conn, dead_connection);
           }
         }
         else if(data->mstate == CURLM_STATE_CONNECT) {