multi: make the "general" list of easy handles a Curl_llist

Instead of having an especially "unique" linked list handler for the
main list of easy handles within the multi handle, this now uses a
regular Curl_llist for this as well.

With this change, it is also clearer that every easy handle added to a
multi handle belongs to one and only one out of three different lists:

 process - the general one for normal transfer processing

 pending - queued up waiting to get a connection (MSTATE_PENDING)

 msgsent - transfer completed (MSTATE_MSGSENT)

An easy handle must therefore be removed from the current list before it
gets added to another.

Closes #14474
This commit is contained in:
Daniel Stenberg 2024-08-09 15:38:03 +02:00
parent 9e4a2187e7
commit 2c15ee4bdb
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 112 additions and 135 deletions

View file

@ -86,20 +86,16 @@ struct Curl_multi {
this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */
unsigned int magic;
/* We have a doubly-linked list with easy handles */
struct Curl_easy *easyp;
struct Curl_easy *easylp; /* last node */
unsigned int num_easy; /* amount of entries in the linked list above. */
unsigned int num_alive; /* amount of easy handles that are added but have
not yet reached COMPLETE state */
struct Curl_llist msglist; /* a list of messages from completed transfers */
struct Curl_llist pending; /* Curl_easys that are in the
MSTATE_PENDING state */
struct Curl_llist msgsent; /* Curl_easys that are in the
MSTATE_MSGSENT state */
/* Each added easy handle is in ONE of these three lists */
struct Curl_llist process; /* not in PENDING or MSGSENT */
struct Curl_llist pending; /* in PENDING */
struct Curl_llist msgsent; /* in MSGSENT */
/* callback function and user data pointer for the *socket() API */
curl_socket_callback socket_cb;