1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

multi: rename all Curl_one_easy to SessionHandle

This commit is contained in:
Daniel Stenberg 2013-08-02 12:21:11 +02:00
parent 204e340bcd
commit 3cd43bbfec
3 changed files with 23 additions and 25 deletions

View File

@ -68,7 +68,7 @@
((x) && (((struct SessionHandle *)(x))->magic == CURLEASY_MAGIC_NUMBER)) ((x) && (((struct SessionHandle *)(x))->magic == CURLEASY_MAGIC_NUMBER))
static void singlesocket(struct Curl_multi *multi, static void singlesocket(struct Curl_multi *multi,
struct Curl_one_easy *easy); struct SessionHandle *easy);
static int update_timer(struct Curl_multi *multi); static int update_timer(struct Curl_multi *multi);
static bool isHandleAtHead(struct SessionHandle *handle, static bool isHandleAtHead(struct SessionHandle *handle,
@ -105,7 +105,7 @@ static const char * const statename[]={
static void multi_freetimeout(void *a, void *b); static void multi_freetimeout(void *a, void *b);
/* always use this function to change state, to make debugging easier */ /* always use this function to change state, to make debugging easier */
static void mstate(struct Curl_one_easy *easy, CURLMstate state static void mstate(struct SessionHandle *easy, CURLMstate state
#ifdef DEBUGBUILD #ifdef DEBUGBUILD
, int lineno , int lineno
#endif #endif
@ -334,7 +334,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
CURL *easy_handle) CURL *easy_handle)
{ {
struct curl_llist *timeoutlist; struct curl_llist *timeoutlist;
struct Curl_one_easy *easy; struct SessionHandle *easy;
struct Curl_multi *multi = (struct Curl_multi *)multi_handle; struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
struct SessionHandle *data = (struct SessionHandle *)easy_handle; struct SessionHandle *data = (struct SessionHandle *)easy_handle;
struct SessionHandle *new_closure = NULL; struct SessionHandle *new_closure = NULL;
@ -422,14 +422,14 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
easy->state.conn_cache = multi->conn_cache; easy->state.conn_cache = multi->conn_cache;
/* This adds the new entry at the 'end' of the doubly-linked circular /* This adds the new entry at the 'end' of the doubly-linked circular
list of Curl_one_easy structs to try and maintain a FIFO queue so list of SessionHandle structs to try and maintain a FIFO queue so
the pipelined requests are in order. */ the pipelined requests are in order. */
/* We add this new entry last in the list. */ /* We add this new entry last in the list. */
easy->next = NULL; /* end of the line */ easy->next = NULL; /* end of the line */
if(multi->easyp) { if(multi->easyp) {
struct Curl_one_easy *last = multi->easylp; struct SessionHandle *last = multi->easylp;
last->next = easy; last->next = easy;
easy->prev = last; easy->prev = last;
multi->easylp = easy; /* the new last node */ multi->easylp = easy; /* the new last node */
@ -638,7 +638,7 @@ bool Curl_multi_pipeline_enabled(const struct Curl_multi *multi)
void Curl_multi_handlePipeBreak(struct SessionHandle *data) void Curl_multi_handlePipeBreak(struct SessionHandle *data)
{ {
struct Curl_one_easy *one_easy = data->set.one_easy; struct SessionHandle *one_easy = data->set.one_easy;
if(one_easy) if(one_easy)
one_easy->easy_conn = NULL; one_easy->easy_conn = NULL;
@ -671,7 +671,7 @@ static int domore_getsock(struct connectdata *conn,
} }
/* returns bitmapped flags for this handle and its sockets */ /* returns bitmapped flags for this handle and its sockets */
static int multi_getsock(struct Curl_one_easy *easy, static int multi_getsock(struct SessionHandle *easy,
curl_socket_t *socks, /* points to numsocks number curl_socket_t *socks, /* points to numsocks number
of sockets */ of sockets */
int numsocks) int numsocks)
@ -742,7 +742,7 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
Some easy handles may not have connected to the remote host yet, Some easy handles may not have connected to the remote host yet,
and then we must make sure that is done. */ and then we must make sure that is done. */
struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_one_easy *easy; struct SessionHandle *easy;
int this_max_fd=-1; int this_max_fd=-1;
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE]; curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
int bitmap; int bitmap;
@ -791,7 +791,7 @@ CURLMcode curl_multi_wait(CURLM *multi_handle,
int *ret) int *ret)
{ {
struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_one_easy *easy; struct SessionHandle *easy;
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE]; curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
int bitmap; int bitmap;
unsigned int i; unsigned int i;
@ -925,7 +925,7 @@ CURLMcode curl_multi_wait(CURLM *multi_handle,
static CURLMcode multi_runsingle(struct Curl_multi *multi, static CURLMcode multi_runsingle(struct Curl_multi *multi,
struct timeval now, struct timeval now,
struct Curl_one_easy *easy) struct SessionHandle *easy)
{ {
struct Curl_message *msg = NULL; struct Curl_message *msg = NULL;
bool connected; bool connected;
@ -1722,7 +1722,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
{ {
struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_one_easy *easy; struct SessionHandle *easy;
CURLMcode returncode=CURLM_OK; CURLMcode returncode=CURLM_OK;
struct Curl_tree *t; struct Curl_tree *t;
struct timeval now = Curl_tvnow(); struct timeval now = Curl_tvnow();
@ -1803,8 +1803,8 @@ static void close_all_connections(struct Curl_multi *multi)
CURLMcode curl_multi_cleanup(CURLM *multi_handle) CURLMcode curl_multi_cleanup(CURLM *multi_handle)
{ {
struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_one_easy *easy; struct SessionHandle *easy;
struct Curl_one_easy *nexteasy; struct SessionHandle *nexteasy;
if(GOOD_MULTI_HANDLE(multi)) { if(GOOD_MULTI_HANDLE(multi)) {
multi->type = 0; /* not good anymore */ multi->type = 0; /* not good anymore */
@ -1907,7 +1907,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue)
* call the callback accordingly. * call the callback accordingly.
*/ */
static void singlesocket(struct Curl_multi *multi, static void singlesocket(struct Curl_multi *multi,
struct Curl_one_easy *easy) struct SessionHandle *easy)
{ {
curl_socket_t socks[MAX_SOCKSPEREASYHANDLE]; curl_socket_t socks[MAX_SOCKSPEREASYHANDLE];
int i; int i;
@ -2159,7 +2159,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
struct timeval now = Curl_tvnow(); struct timeval now = Curl_tvnow();
if(checkall) { if(checkall) {
struct Curl_one_easy *easy; struct SessionHandle *easy;
/* *perform() deals with running_handles on its own */ /* *perform() deals with running_handles on its own */
result = curl_multi_perform(multi, running_handles); result = curl_multi_perform(multi, running_handles);
@ -2693,7 +2693,7 @@ struct curl_llist *Curl_multi_pipelining_server_bl(struct Curl_multi *multi)
void Curl_multi_process_pending_handles(struct Curl_multi *multi) void Curl_multi_process_pending_handles(struct Curl_multi *multi)
{ {
struct Curl_one_easy *easy; struct SessionHandle *easy;
easy=multi->easyp; easy=multi->easyp;
while(easy) { while(easy) {
@ -2710,7 +2710,7 @@ void Curl_multi_process_pending_handles(struct Curl_multi *multi)
void Curl_multi_dump(const struct Curl_multi *multi_handle) void Curl_multi_dump(const struct Curl_multi *multi_handle)
{ {
struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_one_easy *easy; struct SessionHandle *easy;
int i; int i;
fprintf(stderr, "* Multi status: %d handles, %d alive\n", fprintf(stderr, "* Multi status: %d handles, %d alive\n",
multi->num_easy, multi->num_alive); multi->num_easy, multi->num_alive);

View File

@ -59,8 +59,6 @@ typedef enum {
#define GETSOCK_READABLE (0x00ff) #define GETSOCK_READABLE (0x00ff)
#define GETSOCK_WRITABLE (0xff00) #define GETSOCK_WRITABLE (0xff00)
#define Curl_one_easy SessionHandle
/* This is the struct known as CURLM on the outside */ /* This is the struct known as CURLM on the outside */
struct Curl_multi { struct Curl_multi {
/* First a simple identifier to easier detect if a user mix up /* First a simple identifier to easier detect if a user mix up
@ -68,8 +66,8 @@ struct Curl_multi {
long type; long type;
/* We have a doubly-linked circular list with easy handles */ /* We have a doubly-linked circular list with easy handles */
struct Curl_one_easy *easyp; struct SessionHandle *easyp;
struct Curl_one_easy *easylp; /* last node */ struct SessionHandle *easylp; /* last node */
int num_easy; /* amount of entries in the linked list above. */ 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 int num_alive; /* amount of easy handles that are added but have not yet

View File

@ -1329,7 +1329,7 @@ struct DynamicStatic {
* the 'DynamicStatic' struct. * the 'DynamicStatic' struct.
* Character pointer fields point to dynamic storage, unless otherwise stated. * Character pointer fields point to dynamic storage, unless otherwise stated.
*/ */
struct Curl_one_easy; /* declared and used only in multi.c */
struct Curl_multi; /* declared and used only in multi.c */ struct Curl_multi; /* declared and used only in multi.c */
enum dupstring { enum dupstring {
@ -1492,7 +1492,7 @@ struct UserDefined {
long buffer_size; /* size of receive buffer to use */ long buffer_size; /* size of receive buffer to use */
void *private_data; /* application-private data */ void *private_data; /* application-private data */
struct Curl_one_easy *one_easy; /* When adding an easy handle to a multi struct SessionHandle *one_easy; /* When adding an easy handle to a multi
handle, an internal 'Curl_one_easy' handle, an internal 'Curl_one_easy'
struct is created and this is a pointer struct is created and this is a pointer
to the particular struct associated with to the particular struct associated with
@ -1621,8 +1621,8 @@ struct Names {
struct SessionHandle { struct SessionHandle {
/* first, two fields for the linked list of these */ /* first, two fields for the linked list of these */
struct Curl_one_easy *next; struct SessionHandle *next;
struct Curl_one_easy *prev; struct SessionHandle *prev;
struct connectdata *easy_conn; /* the "unit's" connection */ struct connectdata *easy_conn; /* the "unit's" connection */