aboutsummaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-06-21 15:47:12 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-06-22 10:28:41 +0200
commit434f8d0389f2969b393ff81ead713b7600502f27 (patch)
treeba8ab5c680bad171a7a98b8594fa6432fb15bfbd /lib/easy.c
parent9adf3c473a01b289c781aab111f9ad2fc541ed4e (diff)
internals: rename the SessionHandle struct to Curl_easy
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/lib/easy.c b/lib/easy.c
index ea7af5e52..78ca0fa58 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -368,7 +368,7 @@ void curl_global_cleanup(void)
CURL *curl_easy_init(void)
{
CURLcode result;
- struct SessionHandle *data;
+ struct Curl_easy *data;
/* Make sure we inited the global SSL stuff */
if(!initialized) {
@@ -396,13 +396,12 @@ CURL *curl_easy_init(void)
*/
#undef curl_easy_setopt
-CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
+CURLcode curl_easy_setopt(CURL *data, CURLoption tag, ...)
{
va_list arg;
- struct SessionHandle *data = curl;
CURLcode result;
- if(!curl)
+ if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
va_start(arg, tag);
@@ -765,7 +764,7 @@ static CURLcode easy_transfer(CURLM *multi)
* DEBUG: if 'events' is set TRUE, this function will use a replacement engine
* instead of curl_multi_perform() and use curl_multi_socket_action().
*/
-static CURLcode easy_perform(struct SessionHandle *data, bool events)
+static CURLcode easy_perform(struct Curl_easy *data, bool events)
{
CURLM *multi;
CURLMcode mcode;
@@ -827,9 +826,9 @@ static CURLcode easy_perform(struct SessionHandle *data, bool events)
* curl_easy_perform() is the external interface that performs a blocking
* transfer as previously setup.
*/
-CURLcode curl_easy_perform(CURL *easy)
+CURLcode curl_easy_perform(CURL *data)
{
- return easy_perform(easy, FALSE);
+ return easy_perform(data, FALSE);
}
#ifdef CURLDEBUG
@@ -837,9 +836,9 @@ CURLcode curl_easy_perform(CURL *easy)
* curl_easy_perform_ev() is the external interface that performs a blocking
* transfer using the event-based API internally.
*/
-CURLcode curl_easy_perform_ev(CURL *easy)
+CURLcode curl_easy_perform_ev(CURL *data)
{
- return easy_perform(easy, TRUE);
+ return easy_perform(data, TRUE);
}
#endif
@@ -848,9 +847,8 @@ CURLcode curl_easy_perform_ev(CURL *easy)
* curl_easy_cleanup() is the external interface to cleaning/freeing the given
* easy handle.
*/
-void curl_easy_cleanup(CURL *curl)
+void curl_easy_cleanup(CURL *data)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
SIGPIPE_VARIABLE(pipe_st);
if(!data)
@@ -866,12 +864,11 @@ void curl_easy_cleanup(CURL *curl)
* information from a performed transfer and similar.
*/
#undef curl_easy_getinfo
-CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
+CURLcode curl_easy_getinfo(CURL *data, CURLINFO info, ...)
{
va_list arg;
void *paramp;
CURLcode result;
- struct SessionHandle *data = (struct SessionHandle *)curl;
va_start(arg, info);
paramp = va_arg(arg, void *);
@@ -887,11 +884,9 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
* given input easy handle. The returned handle will be a new working handle
* with all options set exactly as the input source handle.
*/
-CURL *curl_easy_duphandle(CURL *incurl)
+CURL *curl_easy_duphandle(CURL *data)
{
- struct SessionHandle *data=(struct SessionHandle *)incurl;
-
- struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle));
+ struct Curl_easy *outcurl = calloc(1, sizeof(struct Curl_easy));
if(NULL == outcurl)
goto fail;
@@ -982,10 +977,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
* curl_easy_reset() is an external interface that allows an app to re-
* initialize a session handle to the default values.
*/
-void curl_easy_reset(CURL *curl)
+void curl_easy_reset(CURL *data)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
-
Curl_safefree(data->state.pathbuffer);
data->state.path = NULL;
@@ -1014,9 +1007,8 @@ void curl_easy_reset(CURL *curl)
*
* Action is a bitmask consisting of CURLPAUSE_* bits in curl/curl.h
*/
-CURLcode curl_easy_pause(CURL *curl, int action)
+CURLcode curl_easy_pause(CURL *data, int action)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
struct SingleRequest *k = &data->req;
CURLcode result = CURLE_OK;
@@ -1056,7 +1048,7 @@ CURLcode curl_easy_pause(CURL *curl, int action)
}
-static CURLcode easy_connection(struct SessionHandle *data,
+static CURLcode easy_connection(struct Curl_easy *data,
curl_socket_t *sfd,
struct connectdata **connp)
{
@@ -1084,13 +1076,12 @@ static CURLcode easy_connection(struct SessionHandle *data,
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
* Returns CURLE_OK on success, error code on error.
*/
-CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
+CURLcode curl_easy_recv(CURL *data, void *buffer, size_t buflen, size_t *n)
{
curl_socket_t sfd;
CURLcode result;
ssize_t n1;
struct connectdata *c;
- struct SessionHandle *data = (struct SessionHandle *)curl;
result = easy_connection(data, &sfd, &c);
if(result)
@@ -1111,14 +1102,13 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
* Sends data over the connected socket. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
-CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen,
+CURLcode curl_easy_send(CURL *data, const void *buffer, size_t buflen,
size_t *n)
{
curl_socket_t sfd;
CURLcode result;
ssize_t n1;
struct connectdata *c = NULL;
- struct SessionHandle *data = (struct SessionHandle *)curl;
result = easy_connection(data, &sfd, &c);
if(result)