mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
cleanup: removed one function, made one static
Moved Curl_easy_addmulti() from easy.c to multi.c, renamed it to easy_addmulti and made it static. Removed Curl_easy_initHandleData() and uses of it since it was emptied in commit cdda92ab67b47d74a.
This commit is contained in:
parent
e79535bc5e
commit
8a42c2ef8d
19
lib/easy.c
19
lib/easy.c
@ -591,20 +591,6 @@ void curl_easy_cleanup(CURL *curl)
|
|||||||
sigpipe_restore(&pipe_st);
|
sigpipe_restore(&pipe_st);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Store a pointed to the multi handle within the easy handle's data struct.
|
|
||||||
*/
|
|
||||||
void Curl_easy_addmulti(struct SessionHandle *data,
|
|
||||||
void *multi)
|
|
||||||
{
|
|
||||||
data->multi = multi;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Curl_easy_initHandleData(struct SessionHandle *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* curl_easy_getinfo() is an external interface that allows an app to retrieve
|
* curl_easy_getinfo() is an external interface that allows an app to retrieve
|
||||||
* information from a performed transfer and similar.
|
* information from a performed transfer and similar.
|
||||||
@ -701,8 +687,6 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
|||||||
|
|
||||||
Curl_convert_setup(outcurl);
|
Curl_convert_setup(outcurl);
|
||||||
|
|
||||||
Curl_easy_initHandleData(outcurl);
|
|
||||||
|
|
||||||
outcurl->magic = CURLEASY_MAGIC_NUMBER;
|
outcurl->magic = CURLEASY_MAGIC_NUMBER;
|
||||||
|
|
||||||
/* we reach this point and thus we are OK */
|
/* we reach this point and thus we are OK */
|
||||||
@ -746,9 +730,6 @@ void curl_easy_reset(CURL *curl)
|
|||||||
/* zero out Progress data: */
|
/* zero out Progress data: */
|
||||||
memset(&data->progress, 0, sizeof(struct Progress));
|
memset(&data->progress, 0, sizeof(struct Progress));
|
||||||
|
|
||||||
/* init Handle data */
|
|
||||||
Curl_easy_initHandleData(data);
|
|
||||||
|
|
||||||
data->progress.flags |= PGRS_HIDE;
|
data->progress.flags |= PGRS_HIDE;
|
||||||
data->state.current_speed = -1; /* init to negative == impossible */
|
data->state.current_speed = -1; /* init to negative == impossible */
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -25,9 +25,6 @@
|
|||||||
/*
|
/*
|
||||||
* Prototypes for library-wide functions provided by easy.c
|
* Prototypes for library-wide functions provided by easy.c
|
||||||
*/
|
*/
|
||||||
void Curl_easy_addmulti(struct SessionHandle *data, void *multi);
|
|
||||||
|
|
||||||
void Curl_easy_initHandleData(struct SessionHandle *data);
|
|
||||||
|
|
||||||
#endif /* HEADER_CURL_EASYIF_H */
|
#endif /* HEADER_CURL_EASYIF_H */
|
||||||
|
|
||||||
|
18
lib/multi.c
18
lib/multi.c
@ -329,6 +329,14 @@ CURLM *curl_multi_init(void)
|
|||||||
CURL_CONNECTION_HASH_SIZE);
|
CURL_CONNECTION_HASH_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Store a pointed to the multi handle within the easy handle's data struct.
|
||||||
|
*/
|
||||||
|
static void easy_addmulti(struct SessionHandle *data,
|
||||||
|
void *multi)
|
||||||
|
{
|
||||||
|
data->multi = multi;
|
||||||
|
}
|
||||||
|
|
||||||
CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||||
CURL *easy_handle)
|
CURL *easy_handle)
|
||||||
@ -391,7 +399,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
|||||||
is associated now with the multi handle which lacked one. */
|
is associated now with the multi handle which lacked one. */
|
||||||
if(new_closure) {
|
if(new_closure) {
|
||||||
multi->closure_handle = new_closure;
|
multi->closure_handle = new_closure;
|
||||||
Curl_easy_addmulti(multi->closure_handle, multi_handle);
|
easy_addmulti(multi->closure_handle, multi_handle);
|
||||||
multi->closure_handle->state.conn_cache = multi->conn_cache;
|
multi->closure_handle->state.conn_cache = multi->conn_cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +457,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make the SessionHandle refer back to this multi handle */
|
/* make the SessionHandle refer back to this multi handle */
|
||||||
Curl_easy_addmulti(data, multi_handle);
|
easy_addmulti(easy_handle, multi_handle);
|
||||||
|
|
||||||
/* Set the timeout for this handle to expire really soon so that it will
|
/* Set the timeout for this handle to expire really soon so that it will
|
||||||
be taken care of even when this handle is added in the midst of operation
|
be taken care of even when this handle is added in the midst of operation
|
||||||
@ -590,8 +598,8 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
|||||||
easy->easy_conn = NULL;
|
easy->easy_conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Curl_easy_addmulti(easy, NULL); /* clear the association
|
easy_addmulti(easy, NULL); /* clear the association to this multi
|
||||||
to this multi handle */
|
handle */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* make sure there's no pending message in the queue sent from this easy
|
/* make sure there's no pending message in the queue sent from this easy
|
||||||
@ -1849,7 +1857,7 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
|
|||||||
/* Clear the pointer to the connection cache */
|
/* Clear the pointer to the connection cache */
|
||||||
easy->state.conn_cache = NULL;
|
easy->state.conn_cache = NULL;
|
||||||
|
|
||||||
Curl_easy_addmulti(easy, NULL); /* clear the association */
|
easy_addmulti(easy, NULL); /* clear the association */
|
||||||
|
|
||||||
easy = nexteasy;
|
easy = nexteasy;
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,6 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
|||||||
res = CURLE_OUT_OF_MEMORY;
|
res = CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Curl_easy_initHandleData(data);
|
|
||||||
res = Curl_init_userdefined(&data->set);
|
res = Curl_init_userdefined(&data->set);
|
||||||
|
|
||||||
data->state.headersize=HEADERSIZE;
|
data->state.headersize=HEADERSIZE;
|
||||||
@ -5791,9 +5790,6 @@ static CURLcode do_init(struct connectdata *conn)
|
|||||||
HTTP. */
|
HTTP. */
|
||||||
data->set.httpreq = HTTPREQ_GET;
|
data->set.httpreq = HTTPREQ_GET;
|
||||||
|
|
||||||
/* NB: the content encoding software depends on this initialization */
|
|
||||||
Curl_easy_initHandleData(data);
|
|
||||||
|
|
||||||
k->start = Curl_tvnow(); /* start time */
|
k->start = Curl_tvnow(); /* start time */
|
||||||
k->now = k->start; /* current time is now */
|
k->now = k->start; /* current time is now */
|
||||||
k->header = TRUE; /* assume header */
|
k->header = TRUE; /* assume header */
|
||||||
|
Loading…
Reference in New Issue
Block a user