]> git.ipfire.org Git - thirdparty/curl.git/commit
multi: remove PENDING + MSGSENT handles from the main linked list
authorDaniel Stenberg <daniel@haxx.se>
Sun, 26 Mar 2023 15:43:28 +0000 (17:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 26 Mar 2023 15:43:28 +0000 (17:43 +0200)
commit843b3baa3e3cb2280064626a530bb9e3e2ccbb9b
treee6e8eb6226f634d0c5d1c7f7d376a9dfdba426f8
parent9d107b6954d5690731f86702105d2e29421f7226
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
lib/ftp.c
lib/multi.c
lib/multihandle.h
lib/transfer.c
lib/url.c
lib/urldata.h