mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
added typedefed function pointers and typecast the NULL assignments in an
attempt to silence picky compilers when assigning data pointers to a function pointer variable
This commit is contained in:
parent
34e7daf989
commit
4d33cf739d
@ -2970,7 +2970,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->remote_port = PORT_HTTP;
|
conn->remote_port = PORT_HTTP;
|
||||||
conn->protocol |= PROT_HTTP;
|
conn->protocol |= PROT_HTTP;
|
||||||
conn->curl_do = Curl_http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_do_more = NULL;
|
conn->curl_do_more = (Curl_do_more_func)NULL;
|
||||||
conn->curl_done = Curl_http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_connect = Curl_http_connect;
|
conn->curl_connect = Curl_http_connect;
|
||||||
#else
|
#else
|
||||||
@ -2987,7 +2987,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->protocol |= PROT_HTTP|PROT_HTTPS|PROT_SSL;
|
conn->protocol |= PROT_HTTP|PROT_HTTPS|PROT_SSL;
|
||||||
|
|
||||||
conn->curl_do = Curl_http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_do_more = NULL;
|
conn->curl_do_more = (Curl_do_more_func)NULL;
|
||||||
conn->curl_done = Curl_http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_connect = Curl_http_connect;
|
conn->curl_connect = Curl_http_connect;
|
||||||
conn->curl_connecting = Curl_https_connecting;
|
conn->curl_connecting = Curl_https_connecting;
|
||||||
@ -3100,7 +3100,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->port = PORT_DICT;
|
conn->port = PORT_DICT;
|
||||||
conn->remote_port = PORT_DICT;
|
conn->remote_port = PORT_DICT;
|
||||||
conn->curl_do = Curl_dict;
|
conn->curl_do = Curl_dict;
|
||||||
conn->curl_done = NULL; /* no DICT-specific done */
|
conn->curl_done = (Curl_done_func)NULL; /* no DICT-specific done */
|
||||||
#else
|
#else
|
||||||
failf(data, LIBCURL_NAME
|
failf(data, LIBCURL_NAME
|
||||||
" was built with DICT disabled!");
|
" was built with DICT disabled!");
|
||||||
@ -3112,7 +3112,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->port = PORT_LDAP;
|
conn->port = PORT_LDAP;
|
||||||
conn->remote_port = PORT_LDAP;
|
conn->remote_port = PORT_LDAP;
|
||||||
conn->curl_do = Curl_ldap;
|
conn->curl_do = Curl_ldap;
|
||||||
conn->curl_done = NULL; /* no LDAP-specific done */
|
conn->curl_done = (Curl_done_func)NULL; /* no LDAP-specific done */
|
||||||
#else
|
#else
|
||||||
failf(data, LIBCURL_NAME
|
failf(data, LIBCURL_NAME
|
||||||
" was built with LDAP disabled!");
|
" was built with LDAP disabled!");
|
||||||
|
@ -541,6 +541,12 @@ struct Curl_async {
|
|||||||
#define FIRSTSOCKET 0
|
#define FIRSTSOCKET 0
|
||||||
#define SECONDARYSOCKET 1
|
#define SECONDARYSOCKET 1
|
||||||
|
|
||||||
|
/* These function pointer types are here only to allow easier typecasting
|
||||||
|
within the source when we need to cast between data pointers (such as NULL)
|
||||||
|
and function pointers. */
|
||||||
|
typedef CURLcode (*Curl_do_more_func)(struct connectdata *);
|
||||||
|
typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The connectdata struct contains all fields and variables that should be
|
* The connectdata struct contains all fields and variables that should be
|
||||||
* unique for an entire connection.
|
* unique for an entire connection.
|
||||||
@ -625,13 +631,13 @@ struct connectdata {
|
|||||||
/* These two functions MUST be set by the curl_connect() function to be
|
/* These two functions MUST be set by the curl_connect() function to be
|
||||||
be protocol dependent */
|
be protocol dependent */
|
||||||
CURLcode (*curl_do)(struct connectdata *, bool *done);
|
CURLcode (*curl_do)(struct connectdata *, bool *done);
|
||||||
CURLcode (*curl_done)(struct connectdata *, CURLcode);
|
Curl_done_func curl_done;
|
||||||
|
|
||||||
/* If the curl_do() function is better made in two halves, this
|
/* If the curl_do() function is better made in two halves, this
|
||||||
* curl_do_more() function will be called afterwards, if set. For example
|
* curl_do_more() function will be called afterwards, if set. For example
|
||||||
* for doing the FTP stuff after the PASV/PORT command.
|
* for doing the FTP stuff after the PASV/PORT command.
|
||||||
*/
|
*/
|
||||||
CURLcode (*curl_do_more)(struct connectdata *);
|
Curl_do_more_func curl_do_more;
|
||||||
|
|
||||||
/* This function *MAY* be set to a protocol-dependent function that is run
|
/* This function *MAY* be set to a protocol-dependent function that is run
|
||||||
* after the connect() and everything is done, as a step in the connection.
|
* after the connect() and everything is done, as a step in the connection.
|
||||||
|
Loading…
Reference in New Issue
Block a user