summaryrefslogtreecommitdiff
path: root/lib/multihandle.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-02 00:09:59 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-03 22:51:35 +0200
commit09b9fc9009bfe6b7b6fd5ba82e81b4ca76539d8d (patch)
treef3ac39747fce5bad3f067cb2746783b3473bf202 /lib/multihandle.h
parent7da3caaf954c3688acbfcb0be7cf188bbfd65fa4 (diff)
downloadcurl-09b9fc9009bfe6b7b6fd5ba82e81b4ca76539d8d.tar.gz
multi: remove 'Curl_one_easy' struct, phase 1
The motivation for having a separate struct that keep track of an easy handle when using the multi handle was removed when we switched to always using the multi interface internally. Now they were just two separate struct that was always allocated for each easy handle. This first step just moves the Curl_one_easy struct members into the SessionHandle struct and hides this somehow (== keeps the source code changes to a minimum) by defining Curl_one_easy to SessionHandle The biggest changes in this commit are: 1 - the linked list of easy handles had to be changed somewhat due to the new struct layout. This made the main linked list pointer get renamed to 'easyp' and there's also a new pointer to the last node, called easylp. It is no longer circular but ends with ->next pointing to NULL. New nodes are still added last. 2 - easy->state is now called easy->mstate to avoid name collision
Diffstat (limited to 'lib/multihandle.h')
-rw-r--r--lib/multihandle.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/multihandle.h b/lib/multihandle.h
index 3fcd9c0e6..714abf6b7 100644
--- a/lib/multihandle.h
+++ b/lib/multihandle.h
@@ -59,26 +59,7 @@ typedef enum {
#define GETSOCK_READABLE (0x00ff)
#define GETSOCK_WRITABLE (0xff00)
-struct Curl_one_easy {
- /* first, two fields for the linked list of these */
- struct Curl_one_easy *next;
- struct Curl_one_easy *prev;
-
- struct SessionHandle *easy_handle; /* the easy handle for this unit */
- struct connectdata *easy_conn; /* the "unit's" connection */
-
- CURLMstate state; /* the handle's state */
- CURLcode result; /* previous result */
-
- struct Curl_message msg; /* A single posted message. */
-
- /* Array with the plain socket numbers this handle takes care of, in no
- particular order. Note that all sockets are added to the sockhash, where
- the state etc are also kept. This array is mostly used to detect when a
- socket is to be removed from the hash. See singlesocket(). */
- curl_socket_t sockets[MAX_SOCKSPEREASYHANDLE];
- int numsocks;
-};
+#define Curl_one_easy SessionHandle
/* This is the struct known as CURLM on the outside */
struct Curl_multi {
@@ -87,7 +68,8 @@ struct Curl_multi {
long type;
/* We have a doubly-linked circular list with easy handles */
- struct Curl_one_easy easy;
+ struct Curl_one_easy *easyp;
+ struct Curl_one_easy *easylp; /* last node */
int num_easy; /* amount of entries in the linked list above. */
int num_alive; /* amount of easy handles that are added but have not yet