summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-03-26 17:43:28 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-03-26 17:43:28 +0200
commit843b3baa3e3cb2280064626a530bb9e3e2ccbb9b (patch)
treee6e8eb6226f634d0c5d1c7f7d376a9dfdba426f8 /lib/url.c
parent9d107b6954d5690731f86702105d2e29421f7226 (diff)
downloadcurl-843b3baa3e3cb2280064626a530bb9e3e2ccbb9b.tar.gz
multi: remove PENDING + MSGSENT handles from the main linked list
As they are not driving transfers or any socket activity, the main loop does not need to iterate over these handles. A performance improvement. They are instead only held in their own separate lists. 'data->multi' is kept a pointer to the multi handle as long as the easy handle is actually part of it even when the handle is moved to the pending/msgsent lists. It needs to know which multi handle it belongs to, if for example curl_easy_cleanup() is called before the handle is removed from the multi handle. Alll 'data->multi' pointers of handles still part of the multi handle gets cleared by curl_multi_cleanup() which "orphans" all previously attached easy handles. This is take 2. The first version was reverted for the 8.0.1 release. Assisted-by: Stefan Eissing Closes #10801
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index f7b4bbbe9..c1fdd1d67 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -346,7 +346,6 @@ static void up_free(struct Curl_easy *data)
CURLcode Curl_close(struct Curl_easy **datap)
{
- struct Curl_multi *m;
struct Curl_easy *data;
if(!datap || !*datap)
@@ -360,8 +359,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
/* Detach connection if any is left. This should not be normal, but can be
the case for example with CONNECT_ONLY + recv/send (test 556) */
Curl_detach_connection(data);
- m = data->multi;
- if(m)
+ if(data->multi)
/* This handle is still part of a multi handle, take care of this first
and detach this handle from there. */
curl_multi_remove_handle(data->multi, data);