summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergely Nagy <ngg@tresorit.com>2019-07-25 10:26:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-07-25 18:06:42 +0200
commita55edcea6530e369b467b00208c58f73f3609307 (patch)
tree7a023b33059e08c61a6a5be4f67e1512352dc3b4
parentcdf7d13bcb144756af8d3ae2dc92d638a65e0e0f (diff)
downloadcurl-a55edcea6530e369b467b00208c58f73f3609307.tar.gz
multi: call detach_connection before Curl_disconnect
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
-rw-r--r--lib/multi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 2b6b1bc52..a9fd1f8b6 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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) {