mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 07:38:49 -05:00
internals: rename the SessionHandle struct to Curl_easy
This commit is contained in:
parent
9adf3c473a
commit
434f8d0389
@ -166,8 +166,8 @@ Windows vs Unix
|
||||
Library
|
||||
=======
|
||||
|
||||
(See `LIBCURL-STRUCTS` for a separate document describing all major internal
|
||||
structs and their purposes.)
|
||||
(See [Structs in libcurl](#structs) for the separate section describing all
|
||||
major internal structs and their purposes.)
|
||||
|
||||
There are plenty of entry points to the library, namely each publicly defined
|
||||
function that libcurl offers to applications. All of those functions are
|
||||
@ -184,14 +184,14 @@ Library
|
||||
|
||||
[ `curl_easy_init()`][2] allocates an internal struct and makes some
|
||||
initializations. The returned handle does not reveal internals. This is the
|
||||
'SessionHandle' struct which works as an "anchor" struct for all `curl_easy`
|
||||
'Curl_easy' struct which works as an "anchor" struct for all `curl_easy`
|
||||
functions. All connections performed will get connect-specific data allocated
|
||||
that should be used for things related to particular connections/requests.
|
||||
|
||||
[`curl_easy_setopt()`][1] takes three arguments, where the option stuff must
|
||||
be passed in pairs: the parameter-ID and the parameter-value. The list of
|
||||
options is documented in the man page. This function mainly sets things in
|
||||
the 'SessionHandle' struct.
|
||||
the 'Curl_easy' struct.
|
||||
|
||||
`curl_easy_perform()` is just a wrapper function that makes use of the multi
|
||||
API. It basically calls `curl_multi_init()`, `curl_multi_add_handle()`,
|
||||
@ -218,7 +218,7 @@ Curl_connect()
|
||||
This function makes sure there's an allocated and initiated 'connectdata'
|
||||
struct that is used for this particular connection only (although there may
|
||||
be several requests performed on the same connect). A bunch of things are
|
||||
inited/inherited from the SessionHandle struct.
|
||||
inited/inherited from the Curl_easy struct.
|
||||
|
||||
<a name="Curl_do"></a>
|
||||
Curl_do()
|
||||
@ -385,11 +385,11 @@ Persistent Connections
|
||||
The persistent connection support in libcurl requires some considerations on
|
||||
how to do things inside of the library.
|
||||
|
||||
- The 'SessionHandle' struct returned in the [`curl_easy_init()`][2] call
|
||||
- The 'Curl_easy' struct returned in the [`curl_easy_init()`][2] call
|
||||
must never hold connection-oriented data. It is meant to hold the root data
|
||||
as well as all the options etc that the library-user may choose.
|
||||
|
||||
- The 'SessionHandle' struct holds the "connection cache" (an array of
|
||||
- The 'Curl_easy' struct holds the "connection cache" (an array of
|
||||
pointers to 'connectdata' structs).
|
||||
|
||||
- This enables the 'curl handle' to be reused on subsequent transfers.
|
||||
@ -856,38 +856,38 @@ Structs in libcurl
|
||||
This section should cover 7.32.0 pretty accurately, but will make sense even
|
||||
for older and later versions as things don't change drastically that often.
|
||||
|
||||
## SessionHandle
|
||||
## Curl_easy
|
||||
|
||||
The SessionHandle handle struct is the one returned to the outside in the
|
||||
external API as a "CURL *". This is usually known as an easy handle in API
|
||||
documentations and examples.
|
||||
The Curl_easy struct is the one returned to the outside in the external API
|
||||
as a "CURL *". This is usually known as an easy handle in API documentations
|
||||
and examples.
|
||||
|
||||
Information and state that is related to the actual connection is in the
|
||||
'connectdata' struct. When a transfer is about to be made, libcurl will
|
||||
either create a new connection or re-use an existing one. The particular
|
||||
connectdata that is used by this handle is pointed out by
|
||||
SessionHandle->easy_conn.
|
||||
Curl_easy->easy_conn.
|
||||
|
||||
Data and information that regard this particular single transfer is put in
|
||||
the SingleRequest sub-struct.
|
||||
|
||||
When the SessionHandle struct is added to a multi handle, as it must be in
|
||||
order to do any transfer, the ->multi member will point to the `Curl_multi`
|
||||
struct it belongs to. The ->prev and ->next members will then be used by the
|
||||
multi code to keep a linked list of SessionHandle structs that are added to
|
||||
that same multi handle. libcurl always uses multi so ->multi *will* point to
|
||||
a `Curl_multi` when a transfer is in progress.
|
||||
When the Curl_easy struct is added to a multi handle, as it must be in order
|
||||
to do any transfer, the ->multi member will point to the `Curl_multi` struct
|
||||
it belongs to. The ->prev and ->next members will then be used by the multi
|
||||
code to keep a linked list of Curl_easy structs that are added to that same
|
||||
multi handle. libcurl always uses multi so ->multi *will* point to a
|
||||
`Curl_multi` when a transfer is in progress.
|
||||
|
||||
->mstate is the multi state of this particular SessionHandle. When
|
||||
->mstate is the multi state of this particular Curl_easy. When
|
||||
`multi_runsingle()` is called, it will act on this handle according to which
|
||||
state it is in. The mstate is also what tells which sockets to return for a
|
||||
specific SessionHandle when [`curl_multi_fdset()`][12] is called etc.
|
||||
specific Curl_easy when [`curl_multi_fdset()`][12] is called etc.
|
||||
|
||||
The libcurl source code generally use the name 'data' for the variable that
|
||||
points to the SessionHandle.
|
||||
points to the Curl_easy.
|
||||
|
||||
When doing multiplexed HTTP/2 transfers, each SessionHandle is associated
|
||||
with an individual stream, sharing the same connectdata struct. Multiplexing
|
||||
When doing multiplexed HTTP/2 transfers, each Curl_easy is associated with
|
||||
an individual stream, sharing the same connectdata struct. Multiplexing
|
||||
makes it even more important to keep things associated with the right thing!
|
||||
|
||||
## connectdata
|
||||
@ -901,22 +901,21 @@ for older and later versions as things don't change drastically that often.
|
||||
the connection can't be kept alive, the connection will be closed after use
|
||||
and then this struct can be removed from the cache and freed.
|
||||
|
||||
Thus, the same SessionHandle can be used multiple times and each time select
|
||||
Thus, the same Curl_easy can be used multiple times and each time select
|
||||
another connectdata struct to use for the connection. Keep this in mind, as
|
||||
it is then important to consider if options or choices are based on the
|
||||
connection or the SessionHandle.
|
||||
connection or the Curl_easy.
|
||||
|
||||
Functions in libcurl will assume that connectdata->data points to the
|
||||
SessionHandle that uses this connection (for the moment).
|
||||
Curl_easy that uses this connection (for the moment).
|
||||
|
||||
As a special complexity, some protocols supported by libcurl require a
|
||||
special disconnect procedure that is more than just shutting down the
|
||||
socket. It can involve sending one or more commands to the server before
|
||||
doing so. Since connections are kept in the connection cache after use, the
|
||||
original SessionHandle may no longer be around when the time comes to shut
|
||||
down a particular connection. For this purpose, libcurl holds a special
|
||||
dummy `closure_handle` SessionHandle in the `Curl_multi` struct to use when
|
||||
needed.
|
||||
original Curl_easy may no longer be around when the time comes to shut down
|
||||
a particular connection. For this purpose, libcurl holds a special dummy
|
||||
`closure_handle` Curl_easy in the `Curl_multi` struct to use when needed.
|
||||
|
||||
FTP uses two TCP connections for a typical transfer but it keeps both in
|
||||
this single struct and thus can be considered a single connection for most
|
||||
@ -932,25 +931,25 @@ for older and later versions as things don't change drastically that often.
|
||||
|
||||
`Curl_multi` is the multi handle struct exposed as "CURLM *" in external APIs.
|
||||
|
||||
This struct holds a list of SessionHandle structs that have been added to
|
||||
this handle with [`curl_multi_add_handle()`][13]. The start of the list is
|
||||
->easyp and ->num_easy is a counter of added SessionHandles.
|
||||
This struct holds a list of Curl_easy structs that have been added to this
|
||||
handle with [`curl_multi_add_handle()`][13]. The start of the list is
|
||||
->easyp and ->num_easy is a counter of added Curl_easys.
|
||||
|
||||
->msglist is a linked list of messages to send back when
|
||||
[`curl_multi_info_read()`][14] is called. Basically a node is added to that
|
||||
list when an individual SessionHandle's transfer has completed.
|
||||
list when an individual Curl_easy's transfer has completed.
|
||||
|
||||
->hostcache points to the name cache. It is a hash table for looking up name
|
||||
to IP. The nodes have a limited life time in there and this cache is meant
|
||||
to reduce the time for when the same name is wanted within a short period of
|
||||
time.
|
||||
|
||||
->timetree points to a tree of SessionHandles, sorted by the remaining time
|
||||
until it should be checked - normally some sort of timeout. Each
|
||||
SessionHandle has one node in the tree.
|
||||
->timetree points to a tree of Curl_easys, sorted by the remaining time
|
||||
until it should be checked - normally some sort of timeout. Each Curl_easy
|
||||
has one node in the tree.
|
||||
|
||||
->sockhash is a hash table to allow fast lookups of socket descriptor to
|
||||
which SessionHandle that uses that descriptor. This is necessary for the
|
||||
which Curl_easy that uses that descriptor. This is necessary for the
|
||||
`multi_socket` API.
|
||||
|
||||
->conn_cache points to the connection cache. It keeps track of all
|
||||
@ -977,11 +976,11 @@ for older and later versions as things don't change drastically that often.
|
||||
setup so HTTPS separate from HTTP.
|
||||
|
||||
->setup_connection is called to allow the protocol code to allocate protocol
|
||||
specific data that then gets associated with that SessionHandle for the rest
|
||||
of this transfer. It gets freed again at the end of the transfer. It will be
|
||||
specific data that then gets associated with that Curl_easy for the rest of
|
||||
this transfer. It gets freed again at the end of the transfer. It will be
|
||||
called before the 'connectdata' for the transfer has been selected/created.
|
||||
Most protocols will allocate its private 'struct [PROTOCOL]' here and assign
|
||||
SessionHandle->req.protop to point to it.
|
||||
Curl_easy->req.protop to point to it.
|
||||
|
||||
->connect_it allows a protocol to do some specific actions after the TCP
|
||||
connect is done, that can still be considered part of the connection phase.
|
||||
@ -1036,7 +1035,7 @@ for older and later versions as things don't change drastically that often.
|
||||
- `PROTOPT_CLOSEACTION` - this protocol has actions to do before closing the
|
||||
connection. This flag is no longer used by code, yet still set for a bunch
|
||||
protocol handlers.
|
||||
|
||||
|
||||
- `PROTOPT_DIRLOCK` - "direction lock". The SSH protocols set this bit to
|
||||
limit which "direction" of socket actions that the main engine will
|
||||
concern itself about.
|
||||
@ -1051,21 +1050,21 @@ for older and later versions as things don't change drastically that often.
|
||||
|
||||
## conncache
|
||||
|
||||
Is a hash table with connections for later re-use. Each SessionHandle has
|
||||
a pointer to its connection cache. Each multi handle sets up a connection
|
||||
cache that all added SessionHandles share by default.
|
||||
Is a hash table with connections for later re-use. Each Curl_easy has a
|
||||
pointer to its connection cache. Each multi handle sets up a connection
|
||||
cache that all added Curl_easys share by default.
|
||||
|
||||
## Curl_share
|
||||
|
||||
|
||||
The libcurl share API allocates a `Curl_share` struct, exposed to the
|
||||
external API as "CURLSH *".
|
||||
|
||||
The idea is that the struct can have a set of own versions of caches and
|
||||
pools and then by providing this struct in the `CURLOPT_SHARE` option, those
|
||||
specific SessionHandles will use the caches/pools that this share handle
|
||||
specific Curl_easys will use the caches/pools that this share handle
|
||||
holds.
|
||||
|
||||
Then individual SessionHandle structs can be made to share specific things
|
||||
Then individual Curl_easy structs can be made to share specific things
|
||||
that they otherwise wouldn't, such as cookies.
|
||||
|
||||
The `Curl_share` struct can currently hold cookies, DNS cache and the SSL
|
||||
@ -1074,7 +1073,7 @@ for older and later versions as things don't change drastically that often.
|
||||
## CookieInfo
|
||||
|
||||
This is the main cookie struct. It holds all known cookies and related
|
||||
information. Each SessionHandle has its own private CookieInfo even when
|
||||
information. Each Curl_easy has its own private CookieInfo even when
|
||||
they are added to a multi handle. They can be made to share cookies by using
|
||||
the share API.
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct SessionHandle CURL;
|
||||
typedef struct Curl_easy CURL;
|
||||
|
||||
/*
|
||||
* libcurl external API function linkage decorations.
|
||||
|
@ -249,7 +249,7 @@ int Curl_resolver_getsock(struct connectdata *conn,
|
||||
|
||||
static int waitperform(struct connectdata *conn, int timeout_ms)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
int nfds;
|
||||
int bitmask;
|
||||
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
|
||||
@ -309,7 +309,7 @@ static int waitperform(struct connectdata *conn, int timeout_ms)
|
||||
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
struct Curl_dns_entry **dns)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ResolverResults *res = (struct ResolverResults *)
|
||||
conn->async.os_specific;
|
||||
CURLcode result = CURLE_OK;
|
||||
@ -353,7 +353,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
long timeout;
|
||||
struct timeval now = Curl_tvnow();
|
||||
struct Curl_dns_entry *temp_entry;
|
||||
@ -492,7 +492,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
int *waitp)
|
||||
{
|
||||
char *bufp;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct in_addr in;
|
||||
int family = PF_INET;
|
||||
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
||||
@ -583,7 +583,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
return NULL; /* no struct yet */
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_servers(struct Curl_easy *data,
|
||||
char *servers)
|
||||
{
|
||||
CURLcode result = CURLE_NOT_BUILT_IN;
|
||||
@ -621,7 +621,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_interface(struct Curl_easy *data,
|
||||
const char *interf)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704)
|
||||
@ -638,7 +638,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
#endif
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
|
||||
const char *local_ip4)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704)
|
||||
@ -663,7 +663,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
#endif
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
|
||||
const char *local_ip6)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704) && defined(ENABLE_IPV6)
|
||||
|
@ -497,7 +497,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
|
||||
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
|
||||
int done = 0;
|
||||
|
||||
@ -671,7 +671,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
|
||||
#endif /* !HAVE_GETADDRINFO */
|
||||
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_servers(struct Curl_easy *data,
|
||||
char *servers)
|
||||
{
|
||||
(void)data;
|
||||
@ -680,7 +680,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_interface(struct Curl_easy *data,
|
||||
const char *interf)
|
||||
{
|
||||
(void)data;
|
||||
@ -688,7 +688,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
|
||||
const char *local_ip4)
|
||||
{
|
||||
(void)data;
|
||||
@ -696,7 +696,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
|
||||
const char *local_ip6)
|
||||
{
|
||||
(void)data;
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
struct addrinfo;
|
||||
struct hostent;
|
||||
struct SessionHandle;
|
||||
struct Curl_easy;
|
||||
struct connectdata;
|
||||
struct Curl_dns_entry;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* Base64 encoding/decoding */
|
||||
|
||||
#include "curl_setup.h"
|
||||
#include "urldata.h" /* for the SessionHandle definition */
|
||||
#include "urldata.h" /* for the Curl_easy definition */
|
||||
#include "warnless.h"
|
||||
#include "curl_base64.h"
|
||||
#include "non-ascii.h"
|
||||
@ -169,7 +169,7 @@ CURLcode Curl_base64_decode(const char *src,
|
||||
}
|
||||
|
||||
static CURLcode base64_encode(const char *table64,
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
@ -283,7 +283,7 @@ static CURLcode base64_encode(const char *table64,
|
||||
*
|
||||
* @unittest: 1302
|
||||
*/
|
||||
CURLcode Curl_base64_encode(struct SessionHandle *data,
|
||||
CURLcode Curl_base64_encode(struct Curl_easy *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
@ -307,7 +307,7 @@ CURLcode Curl_base64_encode(struct SessionHandle *data,
|
||||
*
|
||||
* @unittest: 1302
|
||||
*/
|
||||
CURLcode Curl_base64url_encode(struct SessionHandle *data,
|
||||
CURLcode Curl_base64url_encode(struct Curl_easy *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ static void conn_llist_dtor(void *user, void *element)
|
||||
data->bundle = NULL;
|
||||
}
|
||||
|
||||
static CURLcode bundle_create(struct SessionHandle *data,
|
||||
static CURLcode bundle_create(struct Curl_easy *data,
|
||||
struct connectbundle **cb_ptr)
|
||||
{
|
||||
(void)data;
|
||||
@ -199,7 +199,7 @@ CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
||||
CURLcode result;
|
||||
struct connectbundle *bundle;
|
||||
struct connectbundle *new_bundle = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
bundle = Curl_conncache_find_bundle(conn, data->state.conn_cache);
|
||||
if(!bundle) {
|
||||
|
@ -104,7 +104,7 @@ struct tcp_keepalive {
|
||||
#endif
|
||||
|
||||
static void
|
||||
tcpkeepalive(struct SessionHandle *data,
|
||||
tcpkeepalive(struct Curl_easy *data,
|
||||
curl_socket_t sockfd)
|
||||
{
|
||||
int optval = data->set.tcp_keepalive?1:0;
|
||||
@ -179,7 +179,7 @@ singleipconnect(struct connectdata *conn,
|
||||
*
|
||||
* @unittest: 1303
|
||||
*/
|
||||
long Curl_timeleft(struct SessionHandle *data,
|
||||
long Curl_timeleft(struct Curl_easy *data,
|
||||
struct timeval *nowp,
|
||||
bool duringconnect)
|
||||
{
|
||||
@ -239,7 +239,7 @@ long Curl_timeleft(struct SessionHandle *data,
|
||||
static CURLcode bindlocal(struct connectdata *conn,
|
||||
curl_socket_t sockfd, int af, unsigned int scope)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
struct Curl_sockaddr_storage sa;
|
||||
struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */
|
||||
@ -663,7 +663,7 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
||||
curl_socklen_t len;
|
||||
struct Curl_sockaddr_storage ssrem;
|
||||
struct Curl_sockaddr_storage ssloc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(conn->socktype == SOCK_DGRAM)
|
||||
/* there's no connection! */
|
||||
@ -720,7 +720,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
long allow;
|
||||
int error = 0;
|
||||
@ -871,7 +871,7 @@ void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
|
||||
{
|
||||
#if defined(TCP_NODELAY)
|
||||
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
#endif
|
||||
curl_socklen_t onoff = (curl_socklen_t) 1;
|
||||
int level = IPPROTO_TCP;
|
||||
@ -913,7 +913,7 @@ void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
|
||||
static void nosigpipe(struct connectdata *conn,
|
||||
curl_socket_t sockfd)
|
||||
{
|
||||
struct SessionHandle *data= conn->data;
|
||||
struct Curl_easy *data= conn->data;
|
||||
int onoff = 1;
|
||||
if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff,
|
||||
sizeof(onoff)) < 0)
|
||||
@ -985,7 +985,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
|
||||
int rc = -1;
|
||||
int error = 0;
|
||||
bool isconnected = FALSE;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t sockfd;
|
||||
CURLcode result;
|
||||
char ipaddress[MAX_IPADR_LEN];
|
||||
@ -1146,7 +1146,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
|
||||
CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
const struct Curl_dns_entry *remotehost)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct timeval before = Curl_tvnow();
|
||||
CURLcode result = CURLE_COULDNT_CONNECT;
|
||||
|
||||
@ -1205,11 +1205,11 @@ static int conn_is_conn(struct connectdata *conn, void *param)
|
||||
|
||||
/*
|
||||
* Used to extract socket and connectdata struct for the most recent
|
||||
* transfer on the given SessionHandle.
|
||||
* transfer on the given Curl_easy.
|
||||
*
|
||||
* The returned socket will be CURL_SOCKET_BAD in case of failure!
|
||||
*/
|
||||
curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||
curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
|
||||
struct connectdata **connp)
|
||||
{
|
||||
curl_socket_t sockfd;
|
||||
@ -1309,7 +1309,7 @@ CURLcode Curl_socket(struct connectdata *conn,
|
||||
struct Curl_sockaddr_ex *addr,
|
||||
curl_socket_t *sockfd)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct Curl_sockaddr_ex dummy;
|
||||
|
||||
if(!addr)
|
||||
|
@ -35,7 +35,7 @@ CURLcode Curl_connecthost(struct connectdata *conn,
|
||||
|
||||
/* generic function that returns how much time there's left to run, according
|
||||
to the timeouts set */
|
||||
long Curl_timeleft(struct SessionHandle *data,
|
||||
long Curl_timeleft(struct Curl_easy *data,
|
||||
struct timeval *nowp,
|
||||
bool duringconnect);
|
||||
|
||||
@ -45,11 +45,11 @@ long Curl_timeleft(struct SessionHandle *data,
|
||||
|
||||
/*
|
||||
* Used to extract socket and connectdata struct for the most recent
|
||||
* transfer on the given SessionHandle.
|
||||
* transfer on the given Curl_easy.
|
||||
*
|
||||
* The returned socket will be CURL_SOCKET_BAD in case of failure!
|
||||
*/
|
||||
curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||
curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
|
||||
struct connectdata **connp);
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
|
@ -67,7 +67,7 @@ zfree_cb(voidpf opaque, voidpf ptr)
|
||||
static CURLcode
|
||||
process_zlib_error(struct connectdata *conn, z_stream *z)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
if(z->msg)
|
||||
failf (data, "Error while processing content unencoding: %s",
|
||||
z->msg);
|
||||
@ -425,7 +425,7 @@ Curl_unencode_gzip_write(struct connectdata *conn,
|
||||
|
||||
void Curl_unencode_cleanup(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SingleRequest *k = &data->req;
|
||||
z_stream *z = &k->z;
|
||||
if(k->zlib_init != ZLIB_UNINIT)
|
||||
|
14
lib/cookie.c
14
lib/cookie.c
@ -26,13 +26,13 @@
|
||||
RECEIVING COOKIE INFORMATION
|
||||
============================
|
||||
|
||||
struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
|
||||
const char *file, struct CookieInfo *inc, bool newsession);
|
||||
|
||||
Inits a cookie struct to store data in a local file. This is always
|
||||
called before any cookies are set.
|
||||
|
||||
struct Cookie *Curl_cookie_add(struct SessionHandle *data,
|
||||
struct Cookie *Curl_cookie_add(struct Curl_easy *data,
|
||||
struct CookieInfo *c, bool httpheader, char *lineptr,
|
||||
const char *domain, const char *path);
|
||||
|
||||
@ -260,7 +260,7 @@ static char *sanitize_cookie_path(const char *cookie_path)
|
||||
*
|
||||
* NOTE: OOM or cookie parsing failures are ignored.
|
||||
*/
|
||||
void Curl_cookie_loadfiles(struct SessionHandle *data)
|
||||
void Curl_cookie_loadfiles(struct Curl_easy *data)
|
||||
{
|
||||
struct curl_slist *list = data->change.cookielist;
|
||||
if(list) {
|
||||
@ -362,7 +362,7 @@ static bool isip(const char *domain)
|
||||
***************************************************************************/
|
||||
|
||||
struct Cookie *
|
||||
Curl_cookie_add(struct SessionHandle *data,
|
||||
Curl_cookie_add(struct Curl_easy *data,
|
||||
/* The 'data' pointer here may be NULL at times, and thus
|
||||
must only be used very carefully for things that can deal
|
||||
with data being NULL. Such as infof() and similar */
|
||||
@ -913,7 +913,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
*
|
||||
* Returns NULL on out of memory. Invalid cookies are ignored.
|
||||
****************************************************************************/
|
||||
struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
|
||||
const char *file,
|
||||
struct CookieInfo *inc,
|
||||
bool newsession)
|
||||
@ -1326,7 +1326,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct curl_slist *Curl_cookie_list(struct SessionHandle *data)
|
||||
struct curl_slist *Curl_cookie_list(struct Curl_easy *data)
|
||||
{
|
||||
struct curl_slist *list = NULL;
|
||||
struct curl_slist *beg;
|
||||
@ -1357,7 +1357,7 @@ struct curl_slist *Curl_cookie_list(struct SessionHandle *data)
|
||||
return list;
|
||||
}
|
||||
|
||||
void Curl_flush_cookies(struct SessionHandle *data, int cleanup)
|
||||
void Curl_flush_cookies(struct Curl_easy *data, int cleanup)
|
||||
{
|
||||
if(data->set.str[STRING_COOKIEJAR]) {
|
||||
if(data->change.cookielist) {
|
||||
|
12
lib/cookie.h
12
lib/cookie.h
@ -70,13 +70,13 @@ struct CookieInfo {
|
||||
#define MAX_NAME 1024
|
||||
#define MAX_NAME_TXT "1023"
|
||||
|
||||
struct SessionHandle;
|
||||
struct Curl_easy;
|
||||
/*
|
||||
* Add a cookie to the internal list of cookies. The domain and path arguments
|
||||
* are only used if the header boolean is TRUE.
|
||||
*/
|
||||
|
||||
struct Cookie *Curl_cookie_add(struct SessionHandle *data,
|
||||
struct Cookie *Curl_cookie_add(struct Curl_easy *data,
|
||||
struct CookieInfo *, bool header, char *lineptr,
|
||||
const char *domain, const char *path);
|
||||
|
||||
@ -93,12 +93,12 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies);
|
||||
#define Curl_cookie_cleanup(x) Curl_nop_stmt
|
||||
#define Curl_flush_cookies(x,y) Curl_nop_stmt
|
||||
#else
|
||||
void Curl_flush_cookies(struct SessionHandle *data, int cleanup);
|
||||
void Curl_flush_cookies(struct Curl_easy *data, int cleanup);
|
||||
void Curl_cookie_cleanup(struct CookieInfo *);
|
||||
struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
|
||||
const char *, struct CookieInfo *, bool);
|
||||
struct curl_slist *Curl_cookie_list(struct SessionHandle *data);
|
||||
void Curl_cookie_loadfiles(struct SessionHandle *data);
|
||||
struct curl_slist *Curl_cookie_list(struct Curl_easy *data);
|
||||
void Curl_cookie_loadfiles(struct Curl_easy *data);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_COOKIE_H */
|
||||
|
@ -22,10 +22,10 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
CURLcode Curl_base64_encode(struct SessionHandle *data,
|
||||
CURLcode Curl_base64_encode(struct Curl_easy *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen);
|
||||
CURLcode Curl_base64url_encode(struct SessionHandle *data,
|
||||
CURLcode Curl_base64url_encode(struct Curl_easy *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen);
|
||||
|
||||
|
@ -33,7 +33,7 @@ static char krb5_oid_bytes[] = "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02";
|
||||
gss_OID_desc Curl_krb5_mech_oid = { 9, &krb5_oid_bytes };
|
||||
|
||||
OM_uint32 Curl_gss_init_sec_context(
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context,
|
||||
gss_name_t target_name,
|
||||
@ -114,7 +114,7 @@ static size_t display_gss_error(OM_uint32 status, int type,
|
||||
* major [in] - The major status code.
|
||||
* minor [in] - The minor status code.
|
||||
*/
|
||||
void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
|
||||
void Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
|
||||
OM_uint32 major, OM_uint32 minor)
|
||||
{
|
||||
char buf[GSS_LOG_BUFFER_LEN];
|
||||
|
@ -44,7 +44,7 @@ extern gss_OID_desc Curl_krb5_mech_oid;
|
||||
|
||||
/* Common method for using GSS-API */
|
||||
OM_uint32 Curl_gss_init_sec_context(
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context,
|
||||
gss_name_t target_name,
|
||||
@ -56,7 +56,7 @@ OM_uint32 Curl_gss_init_sec_context(
|
||||
OM_uint32 *ret_flags);
|
||||
|
||||
/* Helper to log a GSS-API error status */
|
||||
void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
|
||||
void Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
|
||||
OM_uint32 major, OM_uint32 minor);
|
||||
|
||||
/* Provide some definitions missing in old headers */
|
||||
|
@ -411,7 +411,7 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
|
||||
/*
|
||||
* Set up lanmanager hashed password
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
|
||||
const char *password,
|
||||
unsigned char *lmbuffer /* 21 bytes */)
|
||||
{
|
||||
@ -505,7 +505,7 @@ static void ascii_uppercase_to_unicode_le(unsigned char *dest,
|
||||
* Set up nt hashed passwords
|
||||
* @unittest: 1600
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
|
||||
const char *password,
|
||||
unsigned char *ntbuffer /* 21 bytes */)
|
||||
{
|
||||
|
@ -64,12 +64,12 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
|
||||
const unsigned char *plaintext,
|
||||
unsigned char *results);
|
||||
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
|
||||
const char *password,
|
||||
unsigned char *lmbuffer /* 21 bytes */);
|
||||
|
||||
#if USE_NTRESPONSES
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
|
||||
const char *password,
|
||||
unsigned char *ntbuffer /* 21 bytes */);
|
||||
|
||||
|
@ -257,7 +257,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
|
||||
bool force_ir, saslprogress *progress)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
unsigned int enabledmechs;
|
||||
const char *mech = NULL;
|
||||
char *resp = NULL;
|
||||
@ -405,7 +405,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
|
||||
int code, saslprogress *progress)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
saslstate newstate = SASL_FINAL;
|
||||
char *resp = NULL;
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct SessionHandle;
|
||||
struct Curl_easy;
|
||||
struct connectdata;
|
||||
|
||||
/* Authentication mechanism flags */
|
||||
|
@ -91,7 +91,7 @@ const struct Curl_handler Curl_handler_dict = {
|
||||
PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
|
||||
};
|
||||
|
||||
static char *unescape_word(struct SessionHandle *data, const char *inputbuff)
|
||||
static char *unescape_word(struct Curl_easy *data, const char *inputbuff)
|
||||
{
|
||||
char *newp;
|
||||
char *dictp;
|
||||
@ -133,7 +133,7 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
|
||||
char *nthdef = NULL; /* This is not part of the protocol, but required
|
||||
by RFC 2229 */
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
|
||||
char *path = data->state.path;
|
||||
|
44
lib/easy.c
44
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)
|
||||
|
@ -139,7 +139,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
|
||||
* *olen. If length == 0, the length is assumed to be strlen(string).
|
||||
*
|
||||
*/
|
||||
CURLcode Curl_urldecode(struct SessionHandle *data,
|
||||
CURLcode Curl_urldecode(struct Curl_easy *data,
|
||||
const char *string, size_t length,
|
||||
char **ostring, size_t *olen,
|
||||
bool reject_ctrl)
|
||||
|
@ -24,7 +24,7 @@
|
||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||
* allocated string or NULL if an error occurred. */
|
||||
|
||||
CURLcode Curl_urldecode(struct SessionHandle *data,
|
||||
CURLcode Curl_urldecode(struct Curl_easy *data,
|
||||
const char *string, size_t length,
|
||||
char **ostring, size_t *olen,
|
||||
bool reject_crlf);
|
||||
|
@ -135,7 +135,7 @@ static CURLcode file_range(struct connectdata *conn)
|
||||
curl_off_t totalsize=-1;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(data->state.use_range && data->state.range) {
|
||||
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
||||
@ -185,7 +185,7 @@ static CURLcode file_range(struct connectdata *conn)
|
||||
*/
|
||||
static CURLcode file_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char *real_path;
|
||||
struct FILEPROTO *file = data->req.protop;
|
||||
int fd;
|
||||
@ -301,7 +301,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||
int fd;
|
||||
int mode;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char *buf = data->state.buffer;
|
||||
size_t nread;
|
||||
size_t nwrite;
|
||||
@ -428,7 +428,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||
bool size_known;
|
||||
bool fstated=FALSE;
|
||||
ssize_t nread;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char *buf = data->state.buffer;
|
||||
curl_off_t bytecount = 0;
|
||||
int fd;
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "urldata.h" /* for struct SessionHandle */
|
||||
#include "urldata.h" /* for struct Curl_easy */
|
||||
#include "formdata.h"
|
||||
#include "vtls/vtls.h"
|
||||
#include "strequal.h"
|
||||
@ -47,7 +47,7 @@ static char *Curl_basename(char *path);
|
||||
#endif
|
||||
|
||||
static size_t readfromfile(struct Form *form, char *buffer, size_t size);
|
||||
static char *formboundary(struct SessionHandle *data);
|
||||
static char *formboundary(struct Curl_easy *data);
|
||||
|
||||
/* What kind of Content-Type to use on un-specified files with unrecognized
|
||||
extensions. */
|
||||
@ -1136,7 +1136,7 @@ static CURLcode formdata_add_filename(const struct curl_httppost *file,
|
||||
* a NULL pointer in the 'data' argument.
|
||||
*/
|
||||
|
||||
CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||
CURLcode Curl_getformdata(struct Curl_easy *data,
|
||||
struct FormData **finalform,
|
||||
struct curl_httppost *post,
|
||||
const char *custom_content_type,
|
||||
@ -1549,7 +1549,7 @@ char *Curl_formpostheader(void *formp, size_t *len)
|
||||
* formboundary() creates a suitable boundary string and returns an allocated
|
||||
* one.
|
||||
*/
|
||||
static char *formboundary(struct SessionHandle *data)
|
||||
static char *formboundary(struct Curl_easy *data)
|
||||
{
|
||||
/* 24 dashes and 16 hexadecimal digits makes 64 bit (18446744073709551615)
|
||||
combinations */
|
||||
|
@ -70,7 +70,7 @@ typedef struct FormInfo {
|
||||
|
||||
int Curl_FormInit(struct Form *form, struct FormData *formdata);
|
||||
|
||||
CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||
CURLcode Curl_getformdata(struct Curl_easy *data,
|
||||
struct FormData **,
|
||||
struct curl_httppost *post,
|
||||
const char *custom_contenttype,
|
||||
@ -93,6 +93,6 @@ char *Curl_FormBoundary(void);
|
||||
|
||||
void Curl_formclean(struct FormData **);
|
||||
|
||||
CURLcode Curl_formconvert(struct SessionHandle *, struct FormData *);
|
||||
CURLcode Curl_formconvert(struct Curl_easy *, struct FormData *);
|
||||
|
||||
#endif /* HEADER_CURL_FORMDATA_H */
|
||||
|
66
lib/ftp.c
66
lib/ftp.c
@ -327,7 +327,7 @@ static bool isBadFtpString(const char *string)
|
||||
*/
|
||||
static CURLcode AcceptServerConnect(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
|
||||
curl_socket_t s = CURL_SOCKET_BAD;
|
||||
#ifdef ENABLE_IPV6
|
||||
@ -384,7 +384,7 @@ static CURLcode AcceptServerConnect(struct connectdata *conn)
|
||||
* Curl_pgrsTime(..., TIMER_STARTACCEPT);
|
||||
*
|
||||
*/
|
||||
static long ftp_timeleft_accept(struct SessionHandle *data)
|
||||
static long ftp_timeleft_accept(struct Curl_easy *data)
|
||||
{
|
||||
long timeout_ms = DEFAULT_ACCEPT_TIMEOUT;
|
||||
long other;
|
||||
@ -424,7 +424,7 @@ static long ftp_timeleft_accept(struct SessionHandle *data)
|
||||
*/
|
||||
static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t ctrl_sock = conn->sock[FIRSTSOCKET];
|
||||
curl_socket_t data_sock = conn->sock[SECONDARYSOCKET];
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
@ -495,7 +495,7 @@ static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received)
|
||||
*/
|
||||
static CURLcode InitiateTransfer(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
@ -546,7 +546,7 @@ static CURLcode InitiateTransfer(struct connectdata *conn)
|
||||
*/
|
||||
static CURLcode AllowServerConnect(struct connectdata *conn, bool *connected)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
long timeout_ms;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
@ -617,7 +617,7 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
||||
size_t *size) /* size of the response */
|
||||
{
|
||||
struct connectdata *conn = pp->conn;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
#ifdef HAVE_GSSAPI
|
||||
char * const buf = data->state.buffer;
|
||||
#endif
|
||||
@ -689,7 +689,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
long timeout; /* timeout in milliseconds */
|
||||
long interval_ms;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct pingpong *pp = &ftpc->pp;
|
||||
@ -980,7 +980,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
curl_socket_t portsock= CURL_SOCKET_BAD;
|
||||
char myhost[256] = "";
|
||||
|
||||
@ -1403,7 +1403,7 @@ static CURLcode ftp_state_prepare_transfer(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct FTP *ftp = conn->data->req.protop;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(ftp->transfer != FTPTRANSFER_BODY) {
|
||||
/* doesn't transfer any data */
|
||||
@ -1486,7 +1486,7 @@ static CURLcode ftp_state_size(struct connectdata *conn)
|
||||
static CURLcode ftp_state_list(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* If this output is to be machine-parsed, the NLST command might be better
|
||||
to use, since the LIST command output is not specified or standard in any
|
||||
@ -1575,7 +1575,7 @@ static CURLcode ftp_state_type(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct FTP *ftp = conn->data->req.protop;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
|
||||
/* If we have selected NOBODY and HEADER, it means that we only want file
|
||||
@ -1607,7 +1607,7 @@ static CURLcode ftp_state_type(struct connectdata *conn)
|
||||
static CURLcode ftp_state_mdtm(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
|
||||
/* Requested time of file or time-depended transfer? */
|
||||
@ -1632,7 +1632,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct FTP *ftp = conn->data->req.protop;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
int seekerr = CURL_SEEKFUNC_OK;
|
||||
|
||||
@ -1728,7 +1728,7 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
|
||||
ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
bool quote=FALSE;
|
||||
@ -1859,7 +1859,7 @@ static CURLcode proxy_magic(struct connectdata *conn,
|
||||
bool *magicdone)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
#if defined(CURL_DISABLE_PROXY)
|
||||
(void) newhost;
|
||||
@ -1950,7 +1950,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
||||
{
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
CURLcode result;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
struct Curl_dns_entry *addr=NULL;
|
||||
int rc;
|
||||
unsigned short connectport; /* the local port connect() should use! */
|
||||
@ -2125,7 +2125,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
||||
static CURLcode ftp_state_port_resp(struct connectdata *conn,
|
||||
int ftpcode)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
ftpport fcmd = (ftpport)ftpc->count1;
|
||||
CURLcode result = CURLE_OK;
|
||||
@ -2162,7 +2162,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn,
|
||||
int ftpcode)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
|
||||
@ -2267,7 +2267,7 @@ static CURLcode ftp_state_type_resp(struct connectdata *conn,
|
||||
ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
|
||||
if(ftpcode/100 != 2) {
|
||||
/* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
|
||||
@ -2296,7 +2296,7 @@ static CURLcode ftp_state_retr(struct connectdata *conn,
|
||||
curl_off_t filesize)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
|
||||
@ -2379,7 +2379,7 @@ static CURLcode ftp_state_size_resp(struct connectdata *conn,
|
||||
ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
curl_off_t filesize;
|
||||
char *buf = data->state.buffer;
|
||||
|
||||
@ -2451,7 +2451,7 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
|
||||
int ftpcode, ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(ftpcode>=400) {
|
||||
failf(data, "Failed FTP upload: %0d", ftpcode);
|
||||
@ -2490,7 +2490,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
char *buf = data->state.buffer;
|
||||
|
||||
@ -2647,7 +2647,7 @@ static CURLcode ftp_state_user_resp(struct connectdata *conn,
|
||||
ftpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
(void)instate; /* no use for this yet */
|
||||
@ -2702,7 +2702,7 @@ static CURLcode ftp_state_acct_resp(struct connectdata *conn,
|
||||
int ftpcode)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
if(ftpcode != 230) {
|
||||
failf(data, "ACCT rejected by server: %03d", ftpcode);
|
||||
result = CURLE_FTP_WEIRD_PASS_REPLY; /* FIX */
|
||||
@ -2718,7 +2718,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result;
|
||||
curl_socket_t sock = conn->sock[FIRSTSOCKET];
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
int ftpcode;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct pingpong *pp = &ftpc->pp;
|
||||
@ -3243,7 +3243,7 @@ static CURLcode ftp_connect(struct connectdata *conn,
|
||||
static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct pingpong *pp = &ftpc->pp;
|
||||
@ -3587,7 +3587,7 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
curl_off_t from, to;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
|
||||
if(data->state.use_range && data->state.range) {
|
||||
@ -3645,7 +3645,7 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
|
||||
static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
|
||||
{
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
CURLcode result = CURLE_OK;
|
||||
bool connected = FALSE;
|
||||
@ -4209,7 +4209,7 @@ static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection)
|
||||
(void)ftp_quit(conn); /* ignore errors on the QUIT */
|
||||
|
||||
if(ftpc->entrypath) {
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) {
|
||||
data->state.most_recent_ftp_entrypath = NULL;
|
||||
}
|
||||
@ -4242,7 +4242,7 @@ static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection)
|
||||
static
|
||||
CURLcode ftp_parse_url_path(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
/* the ftp struct is already inited in ftp_connect() */
|
||||
struct FTP *ftp = data->req.protop;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
@ -4494,7 +4494,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result=CURLE_OK;
|
||||
bool connected=FALSE;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
data->req.size = -1; /* make sure this is unknown at this point */
|
||||
|
||||
@ -4528,7 +4528,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
|
||||
|
||||
static CURLcode ftp_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char *type;
|
||||
char command;
|
||||
struct FTP *ftp;
|
||||
|
@ -97,9 +97,9 @@ typedef enum {
|
||||
file */
|
||||
} curl_ftpfile;
|
||||
|
||||
/* This FTP struct is used in the SessionHandle. All FTP data that is
|
||||
/* This FTP struct is used in the Curl_easy. All FTP data that is
|
||||
connection-oriented must be in FTP_conn to properly deal with the fact that
|
||||
perhaps the SessionHandle is changed between the times the connection is
|
||||
perhaps the Curl_easy is changed between the times the connection is
|
||||
used. */
|
||||
struct FTP {
|
||||
curl_off_t *bytecountp;
|
||||
|
@ -39,7 +39,7 @@
|
||||
* This is supposed to be called in the beginning of a perform() session
|
||||
* and should reset all session-info variables
|
||||
*/
|
||||
CURLcode Curl_initinfo(struct SessionHandle *data)
|
||||
CURLcode Curl_initinfo(struct Curl_easy *data)
|
||||
{
|
||||
struct Progress *pro = &data->progress;
|
||||
struct PureInfo *info = &data->info;
|
||||
@ -73,7 +73,7 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode getinfo_char(struct SessionHandle *data, CURLINFO info,
|
||||
static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
|
||||
char **param_charp)
|
||||
{
|
||||
switch(info) {
|
||||
@ -119,7 +119,7 @@ static CURLcode getinfo_char(struct SessionHandle *data, CURLINFO info,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
|
||||
static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
|
||||
long *param_longp)
|
||||
{
|
||||
curl_socket_t sockfd;
|
||||
@ -222,7 +222,7 @@ static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode getinfo_double(struct SessionHandle *data, CURLINFO info,
|
||||
static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info,
|
||||
double *param_doublep)
|
||||
{
|
||||
switch(info) {
|
||||
@ -275,7 +275,7 @@ static CURLcode getinfo_double(struct SessionHandle *data, CURLINFO info,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
|
||||
static CURLcode getinfo_slist(struct Curl_easy *data, CURLINFO info,
|
||||
struct curl_slist **param_slistp)
|
||||
{
|
||||
union {
|
||||
@ -351,7 +351,7 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode getinfo_socket(struct SessionHandle *data, CURLINFO info,
|
||||
static CURLcode getinfo_socket(struct Curl_easy *data, CURLINFO info,
|
||||
curl_socket_t *param_socketp)
|
||||
{
|
||||
switch(info) {
|
||||
@ -365,7 +365,7 @@ static CURLcode getinfo_socket(struct SessionHandle *data, CURLINFO info,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
||||
CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...)
|
||||
{
|
||||
va_list arg;
|
||||
long *param_longp = NULL;
|
||||
|
@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...);
|
||||
CURLcode Curl_initinfo(struct SessionHandle *data);
|
||||
CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...);
|
||||
CURLcode Curl_initinfo(struct Curl_easy *data);
|
||||
|
||||
#endif /* HEADER_CURL_GETINFO_H */
|
||||
|
@ -75,7 +75,7 @@ const struct Curl_handler Curl_handler_gopher = {
|
||||
static CURLcode gopher_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
|
||||
curl_off_t *bytecount = &data->req.bytecount;
|
||||
|
@ -77,7 +77,7 @@ CURLcode Curl_addrinfo_callback(struct connectdata *conn,
|
||||
|
||||
if(CURL_ASYNC_SUCCESS == status) {
|
||||
if(ai) {
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
18
lib/hostip.c
18
lib/hostip.c
@ -254,7 +254,7 @@ hostcache_prune(struct curl_hash *hostcache, long cache_timeout, time_t now)
|
||||
* Library-wide function for pruning the DNS cache. This function takes and
|
||||
* returns the appropriate locks.
|
||||
*/
|
||||
void Curl_hostcache_prune(struct SessionHandle *data)
|
||||
void Curl_hostcache_prune(struct Curl_easy *data)
|
||||
{
|
||||
time_t now;
|
||||
|
||||
@ -293,7 +293,7 @@ fetch_addr(struct connectdata *conn,
|
||||
char *entry_id = NULL;
|
||||
struct Curl_dns_entry *dns = NULL;
|
||||
size_t entry_len;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Create an entry id, based upon the hostname and port */
|
||||
entry_id = create_hostcache_id(hostname, port);
|
||||
@ -345,7 +345,7 @@ Curl_fetch_addr(struct connectdata *conn,
|
||||
const char *hostname,
|
||||
int port)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct Curl_dns_entry *dns = NULL;
|
||||
|
||||
if(data->share)
|
||||
@ -372,7 +372,7 @@ Curl_fetch_addr(struct connectdata *conn,
|
||||
* Returns the Curl_dns_entry entry pointer or NULL if the storage failed.
|
||||
*/
|
||||
struct Curl_dns_entry *
|
||||
Curl_cache_addr(struct SessionHandle *data,
|
||||
Curl_cache_addr(struct Curl_easy *data,
|
||||
Curl_addrinfo *addr,
|
||||
const char *hostname,
|
||||
int port)
|
||||
@ -447,7 +447,7 @@ int Curl_resolv(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
struct Curl_dns_entry *dns = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result;
|
||||
int rc = CURLRESOLV_ERROR; /* default to failure */
|
||||
|
||||
@ -582,7 +582,7 @@ int Curl_resolv_timeout(struct connectdata *conn,
|
||||
#endif /* HAVE_SIGACTION */
|
||||
volatile long timeout;
|
||||
volatile unsigned int prev_alarm = 0;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
#endif /* USE_ALARM_TIMEOUT */
|
||||
int rc;
|
||||
|
||||
@ -716,7 +716,7 @@ clean_up:
|
||||
*
|
||||
* May be called with 'data' == NULL for global cache.
|
||||
*/
|
||||
void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns)
|
||||
void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns)
|
||||
{
|
||||
if(data && data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
@ -758,7 +758,7 @@ int Curl_mk_dnscache(struct curl_hash *hash)
|
||||
* can be done!
|
||||
*/
|
||||
|
||||
void Curl_hostcache_clean(struct SessionHandle *data,
|
||||
void Curl_hostcache_clean(struct Curl_easy *data,
|
||||
struct curl_hash *hash)
|
||||
{
|
||||
if(data && data->share)
|
||||
@ -771,7 +771,7 @@ void Curl_hostcache_clean(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
|
||||
CURLcode Curl_loadhostpairs(struct SessionHandle *data)
|
||||
CURLcode Curl_loadhostpairs(struct Curl_easy *data)
|
||||
{
|
||||
struct curl_slist *hostp;
|
||||
char hostname[256];
|
||||
|
22
lib/hostip.h
22
lib/hostip.h
@ -50,7 +50,7 @@
|
||||
|
||||
struct addrinfo;
|
||||
struct hostent;
|
||||
struct SessionHandle;
|
||||
struct Curl_easy;
|
||||
struct connectdata;
|
||||
|
||||
/*
|
||||
@ -118,7 +118,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
|
||||
|
||||
/* unlock a previously resolved dns entry */
|
||||
void Curl_resolv_unlock(struct SessionHandle *data,
|
||||
void Curl_resolv_unlock(struct Curl_easy *data,
|
||||
struct Curl_dns_entry *dns);
|
||||
|
||||
/* for debugging purposes only: */
|
||||
@ -128,7 +128,7 @@ void Curl_scan_cache_used(void *user, void *ptr);
|
||||
int Curl_mk_dnscache(struct curl_hash *hash);
|
||||
|
||||
/* prune old entries from the DNS cache */
|
||||
void Curl_hostcache_prune(struct SessionHandle *data);
|
||||
void Curl_hostcache_prune(struct Curl_easy *data);
|
||||
|
||||
/* Return # of adresses in a Curl_addrinfo struct */
|
||||
int Curl_num_addresses (const Curl_addrinfo *addr);
|
||||
@ -188,7 +188,7 @@ Curl_fetch_addr(struct connectdata *conn,
|
||||
* Returns the Curl_dns_entry entry pointer or NULL if the storage failed.
|
||||
*/
|
||||
struct Curl_dns_entry *
|
||||
Curl_cache_addr(struct SessionHandle *data, Curl_addrinfo *addr,
|
||||
Curl_cache_addr(struct Curl_easy *data, Curl_addrinfo *addr,
|
||||
const char *hostname, int port);
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
@ -209,42 +209,42 @@ extern sigjmp_buf curl_jmpenv;
|
||||
/*
|
||||
* Function provided by the resolver backend to set DNS servers to use.
|
||||
*/
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers);
|
||||
CURLcode Curl_set_dns_servers(struct Curl_easy *data, char *servers);
|
||||
|
||||
/*
|
||||
* Function provided by the resolver backend to set
|
||||
* outgoing interface to use for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_interface(struct Curl_easy *data,
|
||||
const char *interf);
|
||||
|
||||
/*
|
||||
* Function provided by the resolver backend to set
|
||||
* local IPv4 address to use as source address for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
|
||||
const char *local_ip4);
|
||||
|
||||
/*
|
||||
* Function provided by the resolver backend to set
|
||||
* local IPv6 address to use as source address for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
|
||||
const char *local_ip6);
|
||||
|
||||
/*
|
||||
* Clean off entries from the cache
|
||||
*/
|
||||
void Curl_hostcache_clean(struct SessionHandle *data, struct curl_hash *hash);
|
||||
void Curl_hostcache_clean(struct Curl_easy *data, struct curl_hash *hash);
|
||||
|
||||
/*
|
||||
* Destroy the hostcache of this handle.
|
||||
*/
|
||||
void Curl_hostcache_destroy(struct SessionHandle *data);
|
||||
void Curl_hostcache_destroy(struct Curl_easy *data);
|
||||
|
||||
/*
|
||||
* Populate the cache with specified entries from CURLOPT_RESOLVE.
|
||||
*/
|
||||
CURLcode Curl_loadhostpairs(struct SessionHandle *data);
|
||||
CURLcode Curl_loadhostpairs(struct Curl_easy *data);
|
||||
|
||||
#endif /* HEADER_CURL_HOSTIP_H */
|
||||
|
@ -172,7 +172,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
#endif
|
||||
int pf;
|
||||
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
#endif
|
||||
|
||||
*waitp = 0; /* synchronous response only */
|
||||
|
@ -59,7 +59,7 @@
|
||||
/*
|
||||
* Function provided by the resolver backend to set DNS servers to use.
|
||||
*/
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_servers(struct Curl_easy *data,
|
||||
char *servers)
|
||||
{
|
||||
(void)data;
|
||||
@ -72,7 +72,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
* Function provided by the resolver backend to set
|
||||
* outgoing interface to use for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_interface(struct Curl_easy *data,
|
||||
const char *interf)
|
||||
{
|
||||
(void)data;
|
||||
@ -84,7 +84,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
* Function provided by the resolver backend to set
|
||||
* local IPv4 address to use as source address for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
|
||||
const char *local_ip4)
|
||||
{
|
||||
(void)data;
|
||||
@ -96,7 +96,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
* Function provided by the resolver backend to set
|
||||
* local IPv6 address to use as source address for DNS requests
|
||||
*/
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
|
||||
const char *local_ip6)
|
||||
{
|
||||
(void)data;
|
||||
|
46
lib/http.c
46
lib/http.c
@ -151,7 +151,7 @@ const struct Curl_handler Curl_handler_https = {
|
||||
|
||||
CURLcode Curl_http_setup_conn(struct connectdata *conn)
|
||||
{
|
||||
/* allocate the HTTP-specific struct for the SessionHandle, only to survive
|
||||
/* allocate the HTTP-specific struct for the Curl_easy, only to survive
|
||||
during this request */
|
||||
struct HTTP *http;
|
||||
DEBUGASSERT(conn->data->req.protop == NULL);
|
||||
@ -179,7 +179,7 @@ char *Curl_checkheaders(const struct connectdata *conn,
|
||||
{
|
||||
struct curl_slist *head;
|
||||
size_t thislen = strlen(thisheader);
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
for(head = data->set.headers;head; head=head->next) {
|
||||
if(Curl_raw_nequal(head->data, thisheader, thislen))
|
||||
@ -194,7 +194,7 @@ char *Curl_checkheaders(const struct connectdata *conn,
|
||||
* if proxy headers are not available, then it will lookup into http header
|
||||
* link list
|
||||
*
|
||||
* It takes a connectdata struct as input instead of the SessionHandle simply
|
||||
* It takes a connectdata struct as input instead of the Curl_easy simply
|
||||
* to know if this is a proxy request or not, as it then might check a
|
||||
* different header list.
|
||||
*/
|
||||
@ -203,7 +203,7 @@ char *Curl_checkProxyheaders(const struct connectdata *conn,
|
||||
{
|
||||
struct curl_slist *head;
|
||||
size_t thislen = strlen(thisheader);
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
for(head = (conn->bits.proxy && data->set.sep_headers) ?
|
||||
data->set.proxyheaders : data->set.headers;
|
||||
@ -280,7 +280,7 @@ static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
|
||||
{
|
||||
size_t size = 0;
|
||||
char *authorization = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char **userp;
|
||||
const char *user;
|
||||
const char *pwd;
|
||||
@ -377,7 +377,7 @@ static bool pickoneauth(struct auth *pick)
|
||||
*/
|
||||
static CURLcode http_perhapsrewind(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct HTTP *http = data->req.protop;
|
||||
curl_off_t bytessent;
|
||||
curl_off_t expectsend = -1; /* default is unknown */
|
||||
@ -485,7 +485,7 @@ static CURLcode http_perhapsrewind(struct connectdata *conn)
|
||||
|
||||
CURLcode Curl_http_auth_act(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
bool pickhost = FALSE;
|
||||
bool pickproxy = FALSE;
|
||||
CURLcode result = CURLE_OK;
|
||||
@ -567,7 +567,7 @@ output_auth_headers(struct connectdata *conn,
|
||||
const char *auth = NULL;
|
||||
CURLcode result = CURLE_OK;
|
||||
#if !defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(USE_SPNEGO)
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
#endif
|
||||
#ifdef USE_SPNEGO
|
||||
struct negotiatedata *negdata = proxy ?
|
||||
@ -674,7 +674,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
||||
up the proxy tunnel */
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct auth *authhost;
|
||||
struct auth *authproxy;
|
||||
|
||||
@ -747,7 +747,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
|
||||
/*
|
||||
* This resource requires authentication
|
||||
*/
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
#ifdef USE_SPNEGO
|
||||
struct negotiatedata *negdata = proxy?
|
||||
@ -907,7 +907,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
|
||||
*/
|
||||
static int http_should_fail(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
int httpcode;
|
||||
|
||||
DEBUGASSERT(conn);
|
||||
@ -1441,7 +1441,7 @@ static int https_getsock(struct connectdata *conn,
|
||||
CURLcode Curl_http_done(struct connectdata *conn,
|
||||
CURLcode status, bool premature)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct HTTP *http = data->req.protop;
|
||||
#ifdef USE_NGHTTP2
|
||||
struct http_conn *httpc = &conn->proto.httpc;
|
||||
@ -1539,7 +1539,7 @@ CURLcode Curl_http_done(struct connectdata *conn,
|
||||
* - if any server previously contacted to handle this request only supports
|
||||
* 1.0.
|
||||
*/
|
||||
static bool use_http_1_1plus(const struct SessionHandle *data,
|
||||
static bool use_http_1_1plus(const struct Curl_easy *data,
|
||||
const struct connectdata *conn)
|
||||
{
|
||||
if((data->state.httpversion == 10) || (conn->httpversion == 10))
|
||||
@ -1552,7 +1552,7 @@ static bool use_http_1_1plus(const struct SessionHandle *data,
|
||||
}
|
||||
|
||||
/* check and possibly add an Expect: header */
|
||||
static CURLcode expect100(struct SessionHandle *data,
|
||||
static CURLcode expect100(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
Curl_send_buffer *req_buffer)
|
||||
{
|
||||
@ -1595,7 +1595,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
|
||||
struct curl_slist *h[2];
|
||||
struct curl_slist *headers;
|
||||
int numlists=1; /* by default */
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
int i;
|
||||
|
||||
enum proxy_use proxy;
|
||||
@ -1700,7 +1700,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
||||
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
||||
Curl_send_buffer *req_buffer)
|
||||
{
|
||||
const struct tm *tm;
|
||||
@ -1764,7 +1764,7 @@ CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
||||
*/
|
||||
CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct HTTP *http;
|
||||
const char *ppath = data->state.path;
|
||||
@ -2777,7 +2777,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
* Returns TRUE if member of the list matches prefix of string
|
||||
*/
|
||||
static bool
|
||||
checkhttpprefix(struct SessionHandle *data,
|
||||
checkhttpprefix(struct Curl_easy *data,
|
||||
const char *s)
|
||||
{
|
||||
struct curl_slist *head = data->set.http200aliases;
|
||||
@ -2816,7 +2816,7 @@ checkhttpprefix(struct SessionHandle *data,
|
||||
|
||||
#ifndef CURL_DISABLE_RTSP
|
||||
static bool
|
||||
checkrtspprefix(struct SessionHandle *data,
|
||||
checkrtspprefix(struct Curl_easy *data,
|
||||
const char *s)
|
||||
{
|
||||
|
||||
@ -2844,7 +2844,7 @@ checkrtspprefix(struct SessionHandle *data,
|
||||
#endif /* CURL_DISABLE_RTSP */
|
||||
|
||||
static bool
|
||||
checkprotoprefix(struct SessionHandle *data, struct connectdata *conn,
|
||||
checkprotoprefix(struct Curl_easy *data, struct connectdata *conn,
|
||||
const char *s)
|
||||
{
|
||||
#ifndef CURL_DISABLE_RTSP
|
||||
@ -2862,7 +2862,7 @@ checkprotoprefix(struct SessionHandle *data, struct connectdata *conn,
|
||||
* header. We make sure that the full string fit in the allocated header
|
||||
* buffer, or else we enlarge it.
|
||||
*/
|
||||
static CURLcode header_append(struct SessionHandle *data,
|
||||
static CURLcode header_append(struct Curl_easy *data,
|
||||
struct SingleRequest *k,
|
||||
size_t length)
|
||||
{
|
||||
@ -2900,7 +2900,7 @@ static CURLcode header_append(struct SessionHandle *data,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void print_http_error(struct SessionHandle *data)
|
||||
static void print_http_error(struct Curl_easy *data)
|
||||
{
|
||||
struct SingleRequest *k = &data->req;
|
||||
char *beg = k->p;
|
||||
@ -2940,7 +2940,7 @@ static void print_http_error(struct SessionHandle *data)
|
||||
/*
|
||||
* Read any HTTP header lines from the server and pass them to the client app.
|
||||
*/
|
||||
CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
||||
CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
ssize_t *nread,
|
||||
bool *stop_reading)
|
||||
|
@ -69,7 +69,7 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||
size_t included_body_bytes,
|
||||
int socketindex);
|
||||
|
||||
CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
||||
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
||||
Curl_send_buffer *buf);
|
||||
CURLcode Curl_add_custom_headers(struct connectdata *conn,
|
||||
bool is_connect,
|
||||
@ -87,7 +87,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
|
||||
ssize_t length, ssize_t *wrote);
|
||||
|
||||
/* These functions are in http.c */
|
||||
void Curl_http_auth_stage(struct SessionHandle *data, int stage);
|
||||
void Curl_http_auth_stage(struct Curl_easy *data, int stage);
|
||||
CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
|
||||
const char *auth);
|
||||
CURLcode Curl_http_auth_act(struct connectdata *conn);
|
||||
@ -216,14 +216,14 @@ struct http_conn {
|
||||
nghttp2_session_mem_recv */
|
||||
size_t drain_total; /* sum of all stream's UrlState.drain */
|
||||
|
||||
/* this is a hash of all individual streams (SessionHandle structs) */
|
||||
/* this is a hash of all individual streams (Curl_easy structs) */
|
||||
struct h2settings settings;
|
||||
#else
|
||||
int unused; /* prevent a compiler warning */
|
||||
#endif
|
||||
};
|
||||
|
||||
CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
||||
CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
ssize_t *nread,
|
||||
bool *stop_reading);
|
||||
|
50
lib/http2.c
50
lib/http2.c
@ -139,7 +139,7 @@ static CURLcode http2_disconnect(struct connectdata *conn,
|
||||
}
|
||||
|
||||
/* called from Curl_http_setup_conn */
|
||||
void Curl_http2_setup_req(struct SessionHandle *data)
|
||||
void Curl_http2_setup_req(struct Curl_easy *data)
|
||||
{
|
||||
struct HTTP *http = data->req.protop;
|
||||
|
||||
@ -284,7 +284,7 @@ static ssize_t send_callback(nghttp2_session *h2,
|
||||
/* We pass a pointer to this struct in the push callback, but the contents of
|
||||
the struct are hidden from the user. */
|
||||
struct curl_pushheaders {
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
const nghttp2_push_promise *frame;
|
||||
};
|
||||
|
||||
@ -335,9 +335,9 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static CURL *duphandle(struct SessionHandle *data)
|
||||
static CURL *duphandle(struct Curl_easy *data)
|
||||
{
|
||||
struct SessionHandle *second = curl_easy_duphandle(data);
|
||||
struct Curl_easy *second = curl_easy_duphandle(data);
|
||||
if(second) {
|
||||
/* setup the request struct */
|
||||
struct HTTP *http = calloc(1, sizeof(struct HTTP));
|
||||
@ -363,7 +363,7 @@ static CURL *duphandle(struct SessionHandle *data)
|
||||
}
|
||||
|
||||
|
||||
static int push_promise(struct SessionHandle *data,
|
||||
static int push_promise(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
const nghttp2_push_promise *frame)
|
||||
{
|
||||
@ -378,7 +378,7 @@ static int push_promise(struct SessionHandle *data,
|
||||
struct http_conn *httpc;
|
||||
size_t i;
|
||||
/* clone the parent */
|
||||
struct SessionHandle *newhandle = duphandle(data);
|
||||
struct Curl_easy *newhandle = duphandle(data);
|
||||
if(!newhandle) {
|
||||
infof(data, "failed to duplicate handle\n");
|
||||
rv = 1; /* FAIL HARD */
|
||||
@ -445,7 +445,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
|
||||
{
|
||||
struct connectdata *conn = (struct connectdata *)userp;
|
||||
struct http_conn *httpc = &conn->proto.httpc;
|
||||
struct SessionHandle *data_s = NULL;
|
||||
struct Curl_easy *data_s = NULL;
|
||||
struct HTTP *stream = NULL;
|
||||
static int lastStream = -1;
|
||||
int rv;
|
||||
@ -482,7 +482,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
|
||||
}
|
||||
if(!data_s) {
|
||||
DEBUGF(infof(conn->data,
|
||||
"No SessionHandle associated with stream: %x\n",
|
||||
"No Curl_easy associated with stream: %x\n",
|
||||
stream_id));
|
||||
return 0;
|
||||
}
|
||||
@ -573,7 +573,7 @@ static int on_invalid_frame_recv(nghttp2_session *session,
|
||||
const nghttp2_frame *frame,
|
||||
int lib_error_code, void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s = NULL;
|
||||
struct Curl_easy *data_s = NULL;
|
||||
(void)userp;
|
||||
|
||||
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
|
||||
@ -590,7 +590,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
|
||||
const uint8_t *data, size_t len, void *userp)
|
||||
{
|
||||
struct HTTP *stream;
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
size_t nread;
|
||||
struct connectdata *conn = (struct connectdata *)userp;
|
||||
(void)session;
|
||||
@ -656,7 +656,7 @@ static int before_frame_send(nghttp2_session *session,
|
||||
const nghttp2_frame *frame,
|
||||
void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
(void)userp;
|
||||
|
||||
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
|
||||
@ -670,7 +670,7 @@ static int on_frame_send(nghttp2_session *session,
|
||||
const nghttp2_frame *frame,
|
||||
void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
(void)userp;
|
||||
|
||||
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
|
||||
@ -684,7 +684,7 @@ static int on_frame_not_send(nghttp2_session *session,
|
||||
const nghttp2_frame *frame,
|
||||
int lib_error_code, void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
(void)userp;
|
||||
|
||||
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
|
||||
@ -698,7 +698,7 @@ static int on_frame_not_send(nghttp2_session *session,
|
||||
static int on_stream_close(nghttp2_session *session, int32_t stream_id,
|
||||
uint32_t error_code, void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
struct HTTP *stream;
|
||||
struct connectdata *conn = (struct connectdata *)userp;
|
||||
(void)session;
|
||||
@ -735,7 +735,7 @@ static int on_begin_headers(nghttp2_session *session,
|
||||
const nghttp2_frame *frame, void *userp)
|
||||
{
|
||||
struct HTTP *stream;
|
||||
struct SessionHandle *data_s = NULL;
|
||||
struct Curl_easy *data_s = NULL;
|
||||
(void)userp;
|
||||
|
||||
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
|
||||
@ -802,7 +802,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
|
||||
void *userp)
|
||||
{
|
||||
struct HTTP *stream;
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
int32_t stream_id = frame->hd.stream_id;
|
||||
struct connectdata *conn = (struct connectdata *)userp;
|
||||
(void)flags;
|
||||
@ -914,7 +914,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session,
|
||||
nghttp2_data_source *source,
|
||||
void *userp)
|
||||
{
|
||||
struct SessionHandle *data_s;
|
||||
struct Curl_easy *data_s;
|
||||
struct HTTP *stream = NULL;
|
||||
size_t nread;
|
||||
(void)source;
|
||||
@ -1096,7 +1096,7 @@ static int should_close_session(struct http_conn *httpc) {
|
||||
!nghttp2_session_want_write(httpc->h2);
|
||||
}
|
||||
|
||||
static int h2_session_send(struct SessionHandle *data,
|
||||
static int h2_session_send(struct Curl_easy *data,
|
||||
nghttp2_session *h2);
|
||||
|
||||
/*
|
||||
@ -1105,7 +1105,7 @@ static int h2_session_send(struct SessionHandle *data,
|
||||
* This function returns 0 if it succeeds, or -1 and error code will
|
||||
* be assigned to *err.
|
||||
*/
|
||||
static int h2_process_pending_input(struct SessionHandle *data,
|
||||
static int h2_process_pending_input(struct Curl_easy *data,
|
||||
struct http_conn *httpc,
|
||||
CURLcode *err) {
|
||||
ssize_t nread;
|
||||
@ -1156,7 +1156,7 @@ static int h2_process_pending_input(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
static ssize_t http2_handle_stream_close(struct connectdata *conn,
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
struct HTTP *stream, CURLcode *err) {
|
||||
char *trailer_pos, *trailer_end;
|
||||
CURLcode result;
|
||||
@ -1226,7 +1226,7 @@ static ssize_t http2_handle_stream_close(struct connectdata *conn,
|
||||
* struct.
|
||||
*/
|
||||
|
||||
static void h2_pri_spec(struct SessionHandle *data,
|
||||
static void h2_pri_spec(struct Curl_easy *data,
|
||||
nghttp2_priority_spec *pri_spec)
|
||||
{
|
||||
struct HTTP *depstream = (data->set.stream_depends_on?
|
||||
@ -1244,7 +1244,7 @@ static void h2_pri_spec(struct SessionHandle *data,
|
||||
* dependency settings and if so it submits a PRIORITY frame with the updated
|
||||
* info.
|
||||
*/
|
||||
static int h2_session_send(struct SessionHandle *data,
|
||||
static int h2_session_send(struct Curl_easy *data,
|
||||
nghttp2_session *h2)
|
||||
{
|
||||
struct HTTP *stream = data->req.protop;
|
||||
@ -1279,7 +1279,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
|
||||
ssize_t rv;
|
||||
ssize_t nread;
|
||||
struct http_conn *httpc = &conn->proto.httpc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct HTTP *stream = data->req.protop;
|
||||
|
||||
(void)sockindex; /* we always do HTTP2 on sockindex 0 */
|
||||
@ -1297,7 +1297,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
|
||||
stream->upload_len = 0;
|
||||
|
||||
/*
|
||||
* At this point 'stream' is just in the SessionHandle the connection
|
||||
* At this point 'stream' is just in the Curl_easy the connection
|
||||
* identifies as its owner at this time.
|
||||
*/
|
||||
|
||||
@ -1864,7 +1864,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
|
||||
struct http_conn *httpc = &conn->proto.httpc;
|
||||
int rv;
|
||||
ssize_t nproc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct HTTP *stream = conn->data->req.protop;
|
||||
|
||||
result = Curl_http2_setup(conn);
|
||||
|
@ -50,7 +50,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
|
||||
const char *data, size_t nread);
|
||||
/* called from Curl_http_setup_conn */
|
||||
void Curl_http2_setup_conn(struct connectdata *conn);
|
||||
void Curl_http2_setup_req(struct SessionHandle *data);
|
||||
void Curl_http2_setup_req(struct Curl_easy *data);
|
||||
#else /* USE_NGHTTP2 */
|
||||
#define Curl_http2_init(x) CURLE_UNSUPPORTED_PROTOCOL
|
||||
#define Curl_http2_send_request(x) CURLE_UNSUPPORTED_PROTOCOL
|
||||
|
@ -108,7 +108,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
||||
ssize_t *wrotep)
|
||||
{
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct Curl_chunker *ch = &conn->chunk;
|
||||
struct SingleRequest *k = &data->req;
|
||||
size_t piece;
|
||||
|
@ -45,7 +45,7 @@ CURLcode Curl_input_digest(struct connectdata *conn,
|
||||
const char *header) /* rest of the *-authenticate:
|
||||
header */
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Point to the correct struct with this */
|
||||
struct digestdata *digest;
|
||||
@ -73,7 +73,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
|
||||
const unsigned char *uripath)
|
||||
{
|
||||
CURLcode result;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
unsigned char *path;
|
||||
char *tmp;
|
||||
char *response;
|
||||
@ -169,7 +169,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_digest_cleanup(struct SessionHandle *data)
|
||||
void Curl_digest_cleanup(struct Curl_easy *data)
|
||||
{
|
||||
Curl_auth_digest_cleanup(&data->state.digest);
|
||||
Curl_auth_digest_cleanup(&data->state.proxydigest);
|
||||
|
@ -34,7 +34,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
|
||||
const unsigned char *uripath);
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||
void Curl_digest_cleanup(struct SessionHandle *data);
|
||||
void Curl_digest_cleanup(struct Curl_easy *data);
|
||||
#else
|
||||
#define Curl_digest_cleanup(x) Curl_nop_stmt
|
||||
#endif
|
||||
|
@ -38,7 +38,7 @@
|
||||
CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
||||
const char *header)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
size_t len;
|
||||
|
||||
/* Point to the username, password, service and host */
|
||||
@ -124,7 +124,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
||||
return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_cleanup_negotiate(struct SessionHandle *data)
|
||||
void Curl_cleanup_negotiate(struct Curl_easy *data)
|
||||
{
|
||||
Curl_auth_spnego_cleanup(&data->state.negotiate);
|
||||
Curl_auth_spnego_cleanup(&data->state.proxyneg);
|
||||
|
@ -31,7 +31,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
||||
/* this is for creating Negotiate header output */
|
||||
CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy);
|
||||
|
||||
void Curl_cleanup_negotiate(struct SessionHandle *data);
|
||||
void Curl_cleanup_negotiate(struct Curl_easy *data);
|
||||
|
||||
#endif /* USE_SPNEGO */
|
||||
|
||||
|
@ -107,7 +107,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
bool blocking)
|
||||
{
|
||||
int subversion=0;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
struct SingleRequest *k = &data->req;
|
||||
CURLcode result;
|
||||
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
||||
|
36
lib/imap.c
36
lib/imap.c
@ -648,7 +648,7 @@ static CURLcode imap_perform_authentication(struct connectdata *conn)
|
||||
static CURLcode imap_perform_list(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
char *mailbox;
|
||||
|
||||
@ -683,7 +683,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
|
||||
static CURLcode imap_perform_select(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
char *mailbox;
|
||||
@ -840,7 +840,7 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -860,7 +860,7 @@ static CURLcode imap_state_capability_resp(struct connectdata *conn,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
const char *line = data->state.buffer;
|
||||
size_t wordlen;
|
||||
@ -947,7 +947,7 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -971,7 +971,7 @@ static CURLcode imap_state_auth_resp(struct connectdata *conn,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
saslprogress progress;
|
||||
|
||||
@ -1005,7 +1005,7 @@ static CURLcode imap_state_login_resp(struct connectdata *conn,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -1051,7 +1051,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = conn->data->req.protop;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
const char *line = data->state.buffer;
|
||||
@ -1098,7 +1098,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
struct pingpong *pp = &imapc->pp;
|
||||
const char *ptr = data->state.buffer;
|
||||
@ -1211,7 +1211,7 @@ static CURLcode imap_state_append_resp(struct connectdata *conn, int imapcode,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* No use for this yet */
|
||||
|
||||
@ -1371,12 +1371,12 @@ static CURLcode imap_block_statemach(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Allocate and initialize the struct IMAP for the current SessionHandle if
|
||||
/* Allocate and initialize the struct IMAP for the current Curl_easy if
|
||||
required */
|
||||
static CURLcode imap_init(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap;
|
||||
|
||||
imap = data->req.protop = calloc(sizeof(struct IMAP), 1);
|
||||
@ -1456,7 +1456,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
|
||||
(void)premature;
|
||||
@ -1518,7 +1518,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
|
||||
{
|
||||
/* This is IMAP and no proxy */
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
struct imap_conn *imapc = &conn->proto.imapc;
|
||||
bool selected = FALSE;
|
||||
@ -1683,7 +1683,7 @@ static CURLcode imap_regular_transfer(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
bool connected = FALSE;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Make sure size is unknown at this point */
|
||||
data->req.size = -1;
|
||||
@ -1706,7 +1706,7 @@ static CURLcode imap_regular_transfer(struct connectdata *conn,
|
||||
|
||||
static CURLcode imap_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Initialise the IMAP layer */
|
||||
CURLcode result = imap_init(conn);
|
||||
@ -1971,7 +1971,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
|
||||
{
|
||||
/* The imap struct is already initialised in imap_connect() */
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
const char *begin = data->state.path;
|
||||
const char *ptr = begin;
|
||||
@ -2101,7 +2101,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
|
||||
static CURLcode imap_parse_custom_request(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct IMAP *imap = data->req.protop;
|
||||
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
|
||||
|
||||
|
@ -49,9 +49,9 @@ typedef enum {
|
||||
IMAP_LAST /* never used */
|
||||
} imapstate;
|
||||
|
||||
/* This IMAP struct is used in the SessionHandle. All IMAP data that is
|
||||
/* This IMAP struct is used in the Curl_easy. All IMAP data that is
|
||||
connection-oriented must be in imap_conn to properly deal with the fact that
|
||||
perhaps the SessionHandle is changed between the times the connection is
|
||||
perhaps the Curl_easy is changed between the times the connection is
|
||||
used. */
|
||||
struct IMAP {
|
||||
curl_pp_transfer transfer;
|
||||
|
@ -150,7 +150,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
|
||||
const char *host = conn->host.name;
|
||||
ssize_t nread;
|
||||
curl_socklen_t l = sizeof(conn->local_addr);
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result;
|
||||
const char *service = data->set.str[STRING_SERVICE_NAME] ?
|
||||
data->set.str[STRING_SERVICE_NAME] :
|
||||
|
@ -192,7 +192,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
||||
LDAPMessage *ldapmsg = NULL;
|
||||
LDAPMessage *entryIterator;
|
||||
int num = 0;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
int ldap_proto = LDAP_VERSION3;
|
||||
int ldap_ssl = 0;
|
||||
char *val_b64 = NULL;
|
||||
|
132
lib/multi.c
132
lib/multi.c
@ -64,12 +64,12 @@
|
||||
((x) && (((struct Curl_multi *)(x))->type == CURL_MULTI_HANDLE))
|
||||
|
||||
static void singlesocket(struct Curl_multi *multi,
|
||||
struct SessionHandle *data);
|
||||
struct Curl_easy *data);
|
||||
static int update_timer(struct Curl_multi *multi);
|
||||
|
||||
static CURLMcode add_next_timeout(struct timeval now,
|
||||
struct Curl_multi *multi,
|
||||
struct SessionHandle *d);
|
||||
struct Curl_easy *d);
|
||||
static CURLMcode multi_timeout(struct Curl_multi *multi,
|
||||
long *timeout_ms);
|
||||
|
||||
@ -100,10 +100,10 @@ static const char * const statename[]={
|
||||
static void multi_freetimeout(void *a, void *b);
|
||||
|
||||
/* function pointer called once when switching TO a state */
|
||||
typedef void (*init_multistate_func)(struct SessionHandle *data);
|
||||
typedef void (*init_multistate_func)(struct Curl_easy *data);
|
||||
|
||||
/* always use this function to change state, to make debugging easier */
|
||||
static void mstate(struct SessionHandle *data, CURLMstate state
|
||||
static void mstate(struct Curl_easy *data, CURLMstate state
|
||||
#ifdef DEBUGBUILD
|
||||
, int lineno
|
||||
#endif
|
||||
@ -162,7 +162,7 @@ static void mstate(struct SessionHandle *data, CURLMstate state
|
||||
*/
|
||||
|
||||
struct Curl_sh_entry {
|
||||
struct SessionHandle *easy;
|
||||
struct Curl_easy *easy;
|
||||
int action; /* what action READ/WRITE this socket waits for */
|
||||
curl_socket_t socket; /* mainly to ease debugging */
|
||||
void *socketp; /* settable by users with curl_multi_assign() */
|
||||
@ -185,7 +185,7 @@ static struct Curl_sh_entry *sh_getentry(struct curl_hash *sh,
|
||||
/* make sure this socket is present in the hash for this handle */
|
||||
static struct Curl_sh_entry *sh_addentry(struct curl_hash *sh,
|
||||
curl_socket_t s,
|
||||
struct SessionHandle *data)
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
struct Curl_sh_entry *there = sh_getentry(sh, s);
|
||||
struct Curl_sh_entry *check;
|
||||
@ -356,19 +356,16 @@ CURLM *curl_multi_init(void)
|
||||
CURL_CONNECTION_HASH_SIZE);
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *easy_handle)
|
||||
CURLMcode curl_multi_add_handle(CURLM *multi, CURL *data)
|
||||
{
|
||||
struct curl_llist *timeoutlist;
|
||||
struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data = (struct SessionHandle *)easy_handle;
|
||||
|
||||
/* First, make some basic checks that the CURLM handle is a good handle */
|
||||
if(!GOOD_MULTI_HANDLE(multi))
|
||||
return CURLM_BAD_HANDLE;
|
||||
|
||||
/* Verify that we got a somewhat good easy handle too */
|
||||
if(!GOOD_EASY_HANDLE(easy_handle))
|
||||
if(!GOOD_EASY_HANDLE(data))
|
||||
return CURLM_BAD_EASY_HANDLE;
|
||||
|
||||
/* Prevent users from adding same easy handle more than once and prevent
|
||||
@ -417,14 +414,14 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
data->state.conn_cache = &multi->conn_cache;
|
||||
|
||||
/* This adds the new entry at the 'end' of the doubly-linked circular
|
||||
list of SessionHandle structs to try and maintain a FIFO queue so
|
||||
list of Curl_easy structs to try and maintain a FIFO queue so
|
||||
the pipelined requests are in order. */
|
||||
|
||||
/* We add this new entry last in the list. */
|
||||
|
||||
data->next = NULL; /* end of the line */
|
||||
if(multi->easyp) {
|
||||
struct SessionHandle *last = multi->easylp;
|
||||
struct Curl_easy *last = multi->easylp;
|
||||
last->next = data;
|
||||
data->prev = last;
|
||||
multi->easylp = data; /* the new last node */
|
||||
@ -435,8 +432,8 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
multi->easylp = multi->easyp = data; /* both first and last */
|
||||
}
|
||||
|
||||
/* make the SessionHandle refer back to this multi handle */
|
||||
data->multi = multi_handle;
|
||||
/* make the Curl_easy refer back to this multi handle */
|
||||
data->multi = multi;
|
||||
|
||||
/* 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
|
||||
@ -487,7 +484,7 @@ static void debug_print_sock_hash(void *p)
|
||||
/* Mark the connection as 'idle', or close it if the cache is full.
|
||||
Returns TRUE if the connection is kept, or FALSE if it was closed. */
|
||||
static bool
|
||||
ConnectionDone(struct SessionHandle *data, struct connectdata *conn)
|
||||
ConnectionDone(struct Curl_easy *data, struct connectdata *conn)
|
||||
{
|
||||
/* data->multi->maxconnects can be negative, deal with it. */
|
||||
size_t maxconnects =
|
||||
@ -523,7 +520,7 @@ static CURLcode multi_done(struct connectdata **connp,
|
||||
{
|
||||
CURLcode result;
|
||||
struct connectdata *conn;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
|
||||
DEBUGASSERT(*connp);
|
||||
|
||||
@ -645,12 +642,9 @@ static CURLcode multi_done(struct connectdata **connp,
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle)
|
||||
CURLMcode curl_multi_remove_handle(CURLM *multi, CURL *data)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *easy = curl_handle;
|
||||
struct SessionHandle *data = easy;
|
||||
struct Curl_easy *easy = data;
|
||||
bool premature;
|
||||
bool easy_owns_conn;
|
||||
struct curl_llist_element *e;
|
||||
@ -660,7 +654,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
return CURLM_BAD_HANDLE;
|
||||
|
||||
/* Verify that we got a somewhat good easy handle too */
|
||||
if(!GOOD_EASY_HANDLE(curl_handle))
|
||||
if(!GOOD_EASY_HANDLE(data))
|
||||
return CURLM_BAD_EASY_HANDLE;
|
||||
|
||||
/* Prevent users from trying to remove same easy handle more than once */
|
||||
@ -791,7 +785,7 @@ bool Curl_pipeline_wanted(const struct Curl_multi *multi, int bits)
|
||||
return (multi && (multi->pipelining & bits)) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
void Curl_multi_handlePipeBreak(struct SessionHandle *data)
|
||||
void Curl_multi_handlePipeBreak(struct Curl_easy *data)
|
||||
{
|
||||
data->easy_conn = NULL;
|
||||
}
|
||||
@ -844,7 +838,7 @@ static int domore_getsock(struct connectdata *conn,
|
||||
}
|
||||
|
||||
/* returns bitmapped flags for this handle and its sockets */
|
||||
static int multi_getsock(struct SessionHandle *data,
|
||||
static int multi_getsock(struct Curl_easy *data,
|
||||
curl_socket_t *socks, /* points to numsocks number
|
||||
of sockets */
|
||||
int numsocks)
|
||||
@ -910,15 +904,14 @@ static int multi_getsock(struct SessionHandle *data,
|
||||
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
CURLMcode curl_multi_fdset(CURLM *multi,
|
||||
fd_set *read_fd_set, fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set, int *max_fd)
|
||||
{
|
||||
/* Scan through all the easy handles to get the file descriptors set.
|
||||
Some easy handles may not have connected to the remote host yet,
|
||||
and then we must make sure that is done. */
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
int this_max_fd=-1;
|
||||
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
|
||||
int bitmap;
|
||||
@ -960,14 +953,13 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
return CURLM_OK;
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
CURLMcode curl_multi_wait(CURLM *multi,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
|
||||
int bitmap;
|
||||
unsigned int i;
|
||||
@ -1130,7 +1122,7 @@ static bool multi_ischanged(struct Curl_multi *multi, bool clear)
|
||||
}
|
||||
|
||||
CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
CURLMcode rc;
|
||||
@ -1155,7 +1147,7 @@ static CURLcode multi_reconnect_request(struct connectdata **connp)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct connectdata *conn = *connp;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* This was a re-use of a connection and we got a write error in the
|
||||
* DO-phase. Then we DISCONNECT this connection and have another attempt to
|
||||
@ -1223,7 +1215,7 @@ static CURLcode multi_do(struct connectdata **connp, bool *done)
|
||||
{
|
||||
CURLcode result=CURLE_OK;
|
||||
struct connectdata *conn = *connp;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(conn->handler->do_it) {
|
||||
/* generic protocol-specific function pointer set in curl_connect() */
|
||||
@ -1286,7 +1278,7 @@ static CURLcode multi_do_more(struct connectdata *conn, int *complete)
|
||||
|
||||
static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
||||
struct timeval now,
|
||||
struct SessionHandle *data)
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
struct Curl_message *msg = NULL;
|
||||
bool connected;
|
||||
@ -2102,10 +2094,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
||||
}
|
||||
|
||||
|
||||
CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
||||
CURLMcode curl_multi_perform(CURLM *multi, int *running_handles)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
CURLMcode returncode=CURLM_OK;
|
||||
struct Curl_tree *t;
|
||||
struct timeval now = Curl_tvnow();
|
||||
@ -2172,11 +2163,10 @@ static void close_all_connections(struct Curl_multi *multi)
|
||||
}
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_cleanup(CURLM *multi_handle)
|
||||
CURLMcode curl_multi_cleanup(CURLM *multi)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data;
|
||||
struct SessionHandle *nextdata;
|
||||
struct Curl_easy *data;
|
||||
struct Curl_easy *nextdata;
|
||||
|
||||
if(GOOD_MULTI_HANDLE(multi)) {
|
||||
bool restore_pipe = FALSE;
|
||||
@ -2247,9 +2237,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
|
||||
* beyond. The current design is fully O(1).
|
||||
*/
|
||||
|
||||
CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue)
|
||||
CURLMsg *curl_multi_info_read(CURLM *multi, int *msgs_in_queue)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct Curl_message *msg;
|
||||
|
||||
*msgs_in_queue = 0; /* default to none */
|
||||
@ -2280,7 +2269,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue)
|
||||
* call the callback accordingly.
|
||||
*/
|
||||
static void singlesocket(struct Curl_multi *multi,
|
||||
struct SessionHandle *data)
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
curl_socket_t socks[MAX_SOCKSPEREASYHANDLE];
|
||||
int i;
|
||||
@ -2452,7 +2441,7 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s)
|
||||
/*
|
||||
* add_next_timeout()
|
||||
*
|
||||
* Each SessionHandle has a list of timeouts. The add_next_timeout() is called
|
||||
* Each Curl_easy has a list of timeouts. The add_next_timeout() is called
|
||||
* when it has just been removed from the splay tree because the timeout has
|
||||
* expired. This function is then to advance in the list to pick the next
|
||||
* timeout to use (skip the already expired ones) and add this node back to
|
||||
@ -2463,7 +2452,7 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s)
|
||||
*/
|
||||
static CURLMcode add_next_timeout(struct timeval now,
|
||||
struct Curl_multi *multi,
|
||||
struct SessionHandle *d)
|
||||
struct Curl_easy *d)
|
||||
{
|
||||
struct timeval *tv = &d->state.expiretime;
|
||||
struct curl_llist *list = d->state.timeoutlist;
|
||||
@ -2511,7 +2500,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
|
||||
int *running_handles)
|
||||
{
|
||||
CURLMcode result = CURLM_OK;
|
||||
struct SessionHandle *data = NULL;
|
||||
struct Curl_easy *data = NULL;
|
||||
struct Curl_tree *t;
|
||||
struct timeval now = Curl_tvnow();
|
||||
|
||||
@ -2639,10 +2628,9 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
|
||||
}
|
||||
|
||||
#undef curl_multi_setopt
|
||||
CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMcode curl_multi_setopt(CURLM *multi,
|
||||
CURLMoption option, ...)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
CURLMcode res = CURLM_OK;
|
||||
va_list param;
|
||||
|
||||
@ -2710,33 +2698,32 @@ CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
/* we define curl_multi_socket() in the public multi.h header */
|
||||
#undef curl_multi_socket
|
||||
|
||||
CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
|
||||
CURLMcode curl_multi_socket(CURLM *multi, curl_socket_t s,
|
||||
int *running_handles)
|
||||
{
|
||||
CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s,
|
||||
0, running_handles);
|
||||
CURLMcode result = multi_socket(multi, FALSE, s, 0, running_handles);
|
||||
if(CURLM_OK >= result)
|
||||
update_timer((struct Curl_multi *)multi_handle);
|
||||
update_timer(multi);
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_socket_action(CURLM *multi_handle, curl_socket_t s,
|
||||
CURLMcode curl_multi_socket_action(CURLM *multi, curl_socket_t s,
|
||||
int ev_bitmask, int *running_handles)
|
||||
{
|
||||
CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s,
|
||||
CURLMcode result = multi_socket(multi, FALSE, s,
|
||||
ev_bitmask, running_handles);
|
||||
if(CURLM_OK >= result)
|
||||
update_timer((struct Curl_multi *)multi_handle);
|
||||
update_timer(multi);
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles)
|
||||
CURLMcode curl_multi_socket_all(CURLM *multi, int *running_handles)
|
||||
|
||||
{
|
||||
CURLMcode result = multi_socket((struct Curl_multi *)multi_handle,
|
||||
TRUE, CURL_SOCKET_BAD, 0, running_handles);
|
||||
CURLMcode result = multi_socket(multi, TRUE, CURL_SOCKET_BAD, 0,
|
||||
running_handles);
|
||||
if(CURLM_OK >= result)
|
||||
update_timer((struct Curl_multi *)multi_handle);
|
||||
update_timer(multi);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2775,11 +2762,9 @@ static CURLMcode multi_timeout(struct Curl_multi *multi,
|
||||
return CURLM_OK;
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
CURLMcode curl_multi_timeout(CURLM *multi,
|
||||
long *timeout_ms)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
|
||||
/* First, make some basic checks that the CURLM handle is a good handle */
|
||||
if(!GOOD_MULTI_HANDLE(multi))
|
||||
return CURLM_BAD_HANDLE;
|
||||
@ -2806,7 +2791,7 @@ static int update_timer(struct Curl_multi *multi)
|
||||
multi->timer_lastcall = none;
|
||||
/* there's no timeout now but there was one previously, tell the app to
|
||||
disable it */
|
||||
return multi->timer_cb((CURLM*)multi, -1, multi->timer_userp);
|
||||
return multi->timer_cb(multi, -1, multi->timer_userp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2820,7 +2805,7 @@ static int update_timer(struct Curl_multi *multi)
|
||||
|
||||
multi->timer_lastcall = multi->timetree->key;
|
||||
|
||||
return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp);
|
||||
return multi->timer_cb(multi, timeout_ms, multi->timer_userp);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2892,7 +2877,7 @@ multi_addtimeout(struct curl_llist *timeoutlist,
|
||||
*
|
||||
* Pass zero to clear all timeout values for this handle.
|
||||
*/
|
||||
void Curl_expire(struct SessionHandle *data, long milli)
|
||||
void Curl_expire(struct Curl_easy *data, long milli)
|
||||
{
|
||||
struct Curl_multi *multi = data->multi;
|
||||
struct timeval *nowp = &data->state.expiretime;
|
||||
@ -2986,7 +2971,7 @@ void Curl_expire(struct SessionHandle *data, long milli)
|
||||
* time-out period to expire.
|
||||
*
|
||||
*/
|
||||
void Curl_expire_latest(struct SessionHandle *data, long milli)
|
||||
void Curl_expire_latest(struct Curl_easy *data, long milli)
|
||||
{
|
||||
struct timeval *expire = &data->state.expiretime;
|
||||
|
||||
@ -3015,11 +3000,9 @@ void Curl_expire_latest(struct SessionHandle *data, long milli)
|
||||
Curl_expire(data, milli);
|
||||
}
|
||||
|
||||
CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t s, void *hashp)
|
||||
CURLMcode curl_multi_assign(CURLM *multi, curl_socket_t s, void *hashp)
|
||||
{
|
||||
struct Curl_sh_entry *there = NULL;
|
||||
struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
|
||||
|
||||
there = sh_getentry(&multi->sockhash, s);
|
||||
|
||||
@ -3066,7 +3049,7 @@ void Curl_multi_process_pending_handles(struct Curl_multi *multi)
|
||||
struct curl_llist_element *e = multi->pending->head;
|
||||
|
||||
while(e) {
|
||||
struct SessionHandle *data = e->ptr;
|
||||
struct Curl_easy *data = e->ptr;
|
||||
struct curl_llist_element *next = e->next;
|
||||
|
||||
if(data->mstate == CURLM_STATE_CONNECT_PEND) {
|
||||
@ -3084,10 +3067,9 @@ void Curl_multi_process_pending_handles(struct Curl_multi *multi)
|
||||
}
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
void Curl_multi_dump(const struct Curl_multi *multi_handle)
|
||||
void Curl_multi_dump(struct Curl_multi *multi)
|
||||
{
|
||||
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
int i;
|
||||
fprintf(stderr, "* Multi status: %d handles, %d alive\n",
|
||||
multi->num_easy, multi->num_alive);
|
||||
|
@ -71,8 +71,8 @@ struct Curl_multi {
|
||||
long type;
|
||||
|
||||
/* We have a doubly-linked circular list with easy handles */
|
||||
struct SessionHandle *easyp;
|
||||
struct SessionHandle *easylp; /* last node */
|
||||
struct Curl_easy *easyp;
|
||||
struct Curl_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
|
||||
@ -80,7 +80,7 @@ struct Curl_multi {
|
||||
|
||||
struct curl_llist *msglist; /* a list of messages from completed transfers */
|
||||
|
||||
struct curl_llist *pending; /* SessionHandles that are in the
|
||||
struct curl_llist *pending; /* Curl_easys that are in the
|
||||
CURLM_STATE_CONNECT_PEND state */
|
||||
|
||||
/* callback function and user data pointer for the *socket() API */
|
||||
@ -113,7 +113,7 @@ struct Curl_multi {
|
||||
|
||||
/* This handle will be used for closing the cached connections in
|
||||
curl_multi_cleanup() */
|
||||
struct SessionHandle *closure_handle;
|
||||
struct Curl_easy *closure_handle;
|
||||
|
||||
long maxconnects; /* if >0, a fixed limit of the maximum number of entries
|
||||
we're allowed to grow the connection cache to */
|
||||
|
@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -25,10 +25,10 @@
|
||||
/*
|
||||
* Prototypes for library-wide functions provided by multi.c
|
||||
*/
|
||||
void Curl_expire(struct SessionHandle *data, long milli);
|
||||
void Curl_expire_latest(struct SessionHandle *data, long milli);
|
||||
void Curl_expire(struct Curl_easy *data, long milli);
|
||||
void Curl_expire_latest(struct Curl_easy *data, long milli);
|
||||
bool Curl_pipeline_wanted(const struct Curl_multi* multi, int bits);
|
||||
void Curl_multi_handlePipeBreak(struct SessionHandle *data);
|
||||
void Curl_multi_handlePipeBreak(struct Curl_easy *data);
|
||||
|
||||
/* Internal version of curl_multi_init() accepts size parameters for the
|
||||
socket and connection hashes */
|
||||
@ -51,7 +51,7 @@ struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize);
|
||||
* allow easier tracking of the internal handle's state and what sockets
|
||||
* they use. Only for research and development DEBUGBUILD enabled builds.
|
||||
*/
|
||||
void Curl_multi_dump(const struct Curl_multi *multi_handle);
|
||||
void Curl_multi_dump(struct Curl_multi *multi);
|
||||
#endif
|
||||
|
||||
void Curl_multi_process_pending_handles(struct Curl_multi *multi);
|
||||
@ -92,6 +92,6 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s);
|
||||
* Add a handle and move it into PERFORM state at once. For pushed streams.
|
||||
*/
|
||||
CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
#endif /* HEADER_CURL_MULTIIF_H */
|
||||
|
@ -51,7 +51,7 @@
|
||||
* Curl_convert_clone() returns a malloced copy of the source string (if
|
||||
* returning CURLE_OK), with the data converted to network format.
|
||||
*/
|
||||
CURLcode Curl_convert_clone(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_clone(struct Curl_easy *data,
|
||||
const char *indata,
|
||||
size_t insize,
|
||||
char **outbuf)
|
||||
@ -79,7 +79,7 @@ CURLcode Curl_convert_clone(struct SessionHandle *data,
|
||||
* Curl_convert_to_network() is an internal function for performing ASCII
|
||||
* conversions on non-ASCII platforms. It convers the buffer _in place_.
|
||||
*/
|
||||
CURLcode Curl_convert_to_network(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_to_network(struct Curl_easy *data,
|
||||
char *buffer, size_t length)
|
||||
{
|
||||
if(data->set.convtonetwork) {
|
||||
@ -139,7 +139,7 @@ CURLcode Curl_convert_to_network(struct SessionHandle *data,
|
||||
* Curl_convert_from_network() is an internal function for performing ASCII
|
||||
* conversions on non-ASCII platforms. It convers the buffer _in place_.
|
||||
*/
|
||||
CURLcode Curl_convert_from_network(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_from_network(struct Curl_easy *data,
|
||||
char *buffer, size_t length)
|
||||
{
|
||||
if(data->set.convfromnetwork) {
|
||||
@ -199,7 +199,7 @@ CURLcode Curl_convert_from_network(struct SessionHandle *data,
|
||||
* Curl_convert_from_utf8() is an internal function for performing UTF-8
|
||||
* conversions on non-ASCII platforms.
|
||||
*/
|
||||
CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
|
||||
char *buffer, size_t length)
|
||||
{
|
||||
if(data->set.convfromutf8) {
|
||||
@ -261,9 +261,9 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Init conversion stuff for a SessionHandle
|
||||
* Init conversion stuff for a Curl_easy
|
||||
*/
|
||||
void Curl_convert_init(struct SessionHandle *data)
|
||||
void Curl_convert_init(struct Curl_easy *data)
|
||||
{
|
||||
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
|
||||
/* conversion descriptors for iconv calls */
|
||||
@ -276,9 +276,9 @@ void Curl_convert_init(struct SessionHandle *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup conversion stuff for a SessionHandle
|
||||
* Setup conversion stuff for a Curl_easy
|
||||
*/
|
||||
void Curl_convert_setup(struct SessionHandle *data)
|
||||
void Curl_convert_setup(struct Curl_easy *data)
|
||||
{
|
||||
data->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
|
||||
CURL_ICONV_CODESET_OF_NETWORK);
|
||||
@ -289,10 +289,10 @@ void Curl_convert_setup(struct SessionHandle *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Close conversion stuff for a SessionHandle
|
||||
* Close conversion stuff for a Curl_easy
|
||||
*/
|
||||
|
||||
void Curl_convert_close(struct SessionHandle *data)
|
||||
void Curl_convert_close(struct Curl_easy *data)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
/* close iconv conversion descriptors */
|
||||
@ -314,7 +314,7 @@ void Curl_convert_close(struct SessionHandle *data)
|
||||
* Curl_convert_form() is used from http.c, this converts any form items that
|
||||
need to be sent in the network encoding. Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
|
||||
CURLcode Curl_convert_form(struct Curl_easy *data, struct FormData *form)
|
||||
{
|
||||
CURLcode result;
|
||||
|
||||
|
@ -33,22 +33,22 @@
|
||||
*
|
||||
* If no conversion was needed *outbuf may be NULL.
|
||||
*/
|
||||
CURLcode Curl_convert_clone(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_clone(struct Curl_easy *data,
|
||||
const char *indata,
|
||||
size_t insize,
|
||||
char **outbuf);
|
||||
|
||||
void Curl_convert_init(struct SessionHandle *data);
|
||||
void Curl_convert_setup(struct SessionHandle *data);
|
||||
void Curl_convert_close(struct SessionHandle *data);
|
||||
void Curl_convert_init(struct Curl_easy *data);
|
||||
void Curl_convert_setup(struct Curl_easy *data);
|
||||
void Curl_convert_close(struct Curl_easy *data);
|
||||
|
||||
CURLcode Curl_convert_to_network(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_to_network(struct Curl_easy *data,
|
||||
char *buffer, size_t length);
|
||||
CURLcode Curl_convert_from_network(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_from_network(struct Curl_easy *data,
|
||||
char *buffer, size_t length);
|
||||
CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
|
||||
CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
|
||||
char *buffer, size_t length);
|
||||
CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form);
|
||||
CURLcode Curl_convert_form(struct Curl_easy *data, struct FormData *form);
|
||||
#else
|
||||
#define Curl_convert_clone(a,b,c,d) ((void)a, CURLE_OK)
|
||||
#define Curl_convert_init(x) Curl_nop_stmt
|
||||
|
@ -150,7 +150,7 @@ static CURLcode ldap_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
ldapconninfo *li;
|
||||
LDAPURLDesc *lud;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
int rc, proto;
|
||||
CURLcode status;
|
||||
|
||||
@ -188,7 +188,7 @@ static Sockbuf_IO ldapsb_tls;
|
||||
static CURLcode ldap_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
ldapconninfo *li = conn->proto.generic;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
int rc, proto = LDAP_VERSION3;
|
||||
char hosturl[1024];
|
||||
char *ptr;
|
||||
@ -226,7 +226,7 @@ static CURLcode ldap_connect(struct connectdata *conn, bool *done)
|
||||
static CURLcode ldap_connecting(struct connectdata *conn, bool *done)
|
||||
{
|
||||
ldapconninfo *li = conn->proto.generic;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
LDAPMessage *msg = NULL;
|
||||
struct timeval tv = {0, 1}, *tvp;
|
||||
int rc, err;
|
||||
@ -352,7 +352,7 @@ static CURLcode ldap_do(struct connectdata *conn, bool *done)
|
||||
int rc = 0;
|
||||
LDAPURLDesc *ludp = NULL;
|
||||
int msgid;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
|
||||
connkeep(conn, "OpenLDAP do");
|
||||
|
||||
@ -415,7 +415,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
|
||||
size_t len, CURLcode *err)
|
||||
{
|
||||
ldapconninfo *li = conn->proto.generic;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
ldapreqinfo *lr = data->req.protop;
|
||||
int rc, ret;
|
||||
LDAPMessage *msg = NULL;
|
||||
|
@ -47,7 +47,7 @@
|
||||
long Curl_pp_state_timeout(struct pingpong *pp)
|
||||
{
|
||||
struct connectdata *conn = pp->conn;
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
long timeout_ms; /* in milliseconds */
|
||||
long timeout2_ms; /* in milliseconds */
|
||||
long response_time= (data->set.server_response_timeout)?
|
||||
@ -85,7 +85,7 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block)
|
||||
int rc;
|
||||
long interval_ms;
|
||||
long timeout_ms = Curl_pp_state_timeout(pp);
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct Curl_easy *data=conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(timeout_ms <=0) {
|
||||
@ -165,7 +165,7 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp,
|
||||
char *s;
|
||||
CURLcode result;
|
||||
struct connectdata *conn = pp->conn;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
enum protection_level data_sec = conn->data_prot;
|
||||
@ -271,7 +271,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
|
||||
ssize_t gotbytes;
|
||||
char *ptr;
|
||||
struct connectdata *conn = pp->conn;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char * const buf = data->state.buffer;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
|
@ -57,7 +57,7 @@ static void server_blacklist_llist_dtor(void *user, void *element)
|
||||
free(element);
|
||||
}
|
||||
|
||||
bool Curl_pipeline_penalized(struct SessionHandle *data,
|
||||
bool Curl_pipeline_penalized(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(data) {
|
||||
@ -70,7 +70,7 @@ bool Curl_pipeline_penalized(struct SessionHandle *data,
|
||||
|
||||
/* Find the head of the recv pipe, if any */
|
||||
if(conn->recv_pipe && conn->recv_pipe->head) {
|
||||
struct SessionHandle *recv_handle = conn->recv_pipe->head->ptr;
|
||||
struct Curl_easy *recv_handle = conn->recv_pipe->head->ptr;
|
||||
|
||||
recv_size = recv_handle->req.size;
|
||||
|
||||
@ -91,7 +91,7 @@ bool Curl_pipeline_penalized(struct SessionHandle *data,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static CURLcode addHandleToPipeline(struct SessionHandle *data,
|
||||
static CURLcode addHandleToPipeline(struct Curl_easy *data,
|
||||
struct curl_llist *pipeline)
|
||||
{
|
||||
if(!Curl_llist_insert_next(pipeline, pipeline->tail, data))
|
||||
@ -100,7 +100,7 @@ static CURLcode addHandleToPipeline(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
|
||||
CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
|
||||
CURLcode Curl_add_handle_to_pipeline(struct Curl_easy *handle,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct curl_llist_element *sendhead = conn->send_pipe->head;
|
||||
@ -130,7 +130,7 @@ CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
|
||||
checked to update what sockets it acts on.
|
||||
|
||||
*/
|
||||
void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
|
||||
void Curl_move_handle_from_send_to_recv_pipe(struct Curl_easy *handle,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
@ -162,7 +162,7 @@ void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
|
||||
}
|
||||
}
|
||||
|
||||
bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle,
|
||||
bool Curl_pipeline_site_blacklisted(struct Curl_easy *handle,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(handle->multi) {
|
||||
@ -254,7 +254,7 @@ CURLMcode Curl_pipeline_set_site_blacklist(char **sites,
|
||||
return CURLM_OK;
|
||||
}
|
||||
|
||||
bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle,
|
||||
bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle,
|
||||
char *server_name)
|
||||
{
|
||||
if(handle->multi && server_name) {
|
||||
@ -320,7 +320,7 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
|
||||
return CURLM_OK;
|
||||
}
|
||||
|
||||
static bool pipe_head(struct SessionHandle *data,
|
||||
static bool pipe_head(struct Curl_easy *data,
|
||||
struct curl_llist *pipeline)
|
||||
{
|
||||
if(pipeline) {
|
||||
@ -332,14 +332,14 @@ static bool pipe_head(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
/* returns TRUE if the given handle is head of the recv pipe */
|
||||
bool Curl_recvpipe_head(struct SessionHandle *data,
|
||||
bool Curl_recvpipe_head(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
return pipe_head(data, conn->recv_pipe);
|
||||
}
|
||||
|
||||
/* returns TRUE if the given handle is head of the send pipe */
|
||||
bool Curl_sendpipe_head(struct SessionHandle *data,
|
||||
bool Curl_sendpipe_head(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
return pipe_head(data, conn->send_pipe);
|
||||
@ -353,7 +353,7 @@ bool Curl_sendpipe_head(struct SessionHandle *data,
|
||||
* If not available, return FALSE.
|
||||
*/
|
||||
|
||||
bool Curl_pipeline_checkget_write(struct SessionHandle *data,
|
||||
bool Curl_pipeline_checkget_write(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(conn->bits.multiplex)
|
||||
@ -376,7 +376,7 @@ bool Curl_pipeline_checkget_write(struct SessionHandle *data,
|
||||
* If not available, return FALSE.
|
||||
*/
|
||||
|
||||
bool Curl_pipeline_checkget_read(struct SessionHandle *data,
|
||||
bool Curl_pipeline_checkget_read(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(conn->bits.multiplex)
|
||||
@ -413,7 +413,7 @@ void print_pipeline(struct connectdata *conn)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
struct connectbundle *cb_ptr;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
cb_ptr = conn->bundle;
|
||||
|
||||
|
@ -23,34 +23,34 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
|
||||
CURLcode Curl_add_handle_to_pipeline(struct Curl_easy *handle,
|
||||
struct connectdata *conn);
|
||||
void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
|
||||
void Curl_move_handle_from_send_to_recv_pipe(struct Curl_easy *handle,
|
||||
struct connectdata *conn);
|
||||
bool Curl_pipeline_penalized(struct SessionHandle *data,
|
||||
bool Curl_pipeline_penalized(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
|
||||
bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle,
|
||||
bool Curl_pipeline_site_blacklisted(struct Curl_easy *handle,
|
||||
struct connectdata *conn);
|
||||
|
||||
CURLMcode Curl_pipeline_set_site_blacklist(char **sites,
|
||||
struct curl_llist **list_ptr);
|
||||
|
||||
bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle,
|
||||
bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle,
|
||||
char *server_name);
|
||||
|
||||
CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
|
||||
struct curl_llist **list_ptr);
|
||||
|
||||
bool Curl_pipeline_checkget_write(struct SessionHandle *data,
|
||||
bool Curl_pipeline_checkget_write(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
bool Curl_pipeline_checkget_read(struct SessionHandle *data,
|
||||
bool Curl_pipeline_checkget_read(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
void Curl_pipeline_leave_write(struct connectdata *conn);
|
||||
void Curl_pipeline_leave_read(struct connectdata *conn);
|
||||
bool Curl_recvpipe_head(struct SessionHandle *data,
|
||||
bool Curl_recvpipe_head(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
bool Curl_sendpipe_head(struct SessionHandle *data,
|
||||
bool Curl_sendpipe_head(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
|
||||
#endif /* HEADER_CURL_PIPELINE_H */
|
||||
|
34
lib/pop3.c
34
lib/pop3.c
@ -597,7 +597,7 @@ static CURLcode pop3_perform_authentication(struct connectdata *conn)
|
||||
static CURLcode pop3_perform_command(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3 = data->req.protop;
|
||||
const char *command = NULL;
|
||||
|
||||
@ -653,7 +653,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct pop3_conn *pop3c = &conn->proto.pop3c;
|
||||
const char *line = data->state.buffer;
|
||||
size_t len = strlen(line);
|
||||
@ -704,7 +704,7 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn, int pop3code,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct pop3_conn *pop3c = &conn->proto.pop3c;
|
||||
const char *line = data->state.buffer;
|
||||
size_t len = strlen(line);
|
||||
@ -795,7 +795,7 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -819,7 +819,7 @@ static CURLcode pop3_state_auth_resp(struct connectdata *conn,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct pop3_conn *pop3c = &conn->proto.pop3c;
|
||||
saslprogress progress;
|
||||
|
||||
@ -859,7 +859,7 @@ static CURLcode pop3_state_apop_resp(struct connectdata *conn, int pop3code,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -880,7 +880,7 @@ static CURLcode pop3_state_user_resp(struct connectdata *conn, int pop3code,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -903,7 +903,7 @@ static CURLcode pop3_state_pass_resp(struct connectdata *conn, int pop3code,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -924,7 +924,7 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn,
|
||||
pop3state instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3 = data->req.protop;
|
||||
struct pop3_conn *pop3c = &conn->proto.pop3c;
|
||||
struct pingpong *pp = &pop3c->pp;
|
||||
@ -1078,12 +1078,12 @@ static CURLcode pop3_block_statemach(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Allocate and initialize the POP3 struct for the current SessionHandle if
|
||||
/* Allocate and initialize the POP3 struct for the current Curl_easy if
|
||||
required */
|
||||
static CURLcode pop3_init(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3;
|
||||
|
||||
pop3 = data->req.protop = calloc(sizeof(struct POP3), 1);
|
||||
@ -1160,7 +1160,7 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3 = data->req.protop;
|
||||
|
||||
(void)premature;
|
||||
@ -1324,7 +1324,7 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
bool connected = FALSE;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Make sure size is unknown at this point */
|
||||
data->req.size = -1;
|
||||
@ -1347,7 +1347,7 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn,
|
||||
|
||||
static CURLcode pop3_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Initialise the POP3 layer */
|
||||
CURLcode result = pop3_init(conn);
|
||||
@ -1454,7 +1454,7 @@ static CURLcode pop3_parse_url_options(struct connectdata *conn)
|
||||
static CURLcode pop3_parse_url_path(struct connectdata *conn)
|
||||
{
|
||||
/* The POP3 struct is already initialised in pop3_connect() */
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3 = data->req.protop;
|
||||
const char *path = data->state.path;
|
||||
|
||||
@ -1471,7 +1471,7 @@ static CURLcode pop3_parse_url_path(struct connectdata *conn)
|
||||
static CURLcode pop3_parse_custom_request(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct POP3 *pop3 = data->req.protop;
|
||||
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
|
||||
|
||||
@ -1493,7 +1493,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread)
|
||||
{
|
||||
/* This code could be made into a special function in the handler struct */
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SingleRequest *k = &data->req;
|
||||
|
||||
struct pop3_conn *pop3c = &conn->proto.pop3c;
|
||||
|
@ -45,9 +45,9 @@ typedef enum {
|
||||
POP3_LAST /* never used */
|
||||
} pop3state;
|
||||
|
||||
/* This POP3 struct is used in the SessionHandle. All POP3 data that is
|
||||
/* This POP3 struct is used in the Curl_easy. All POP3 data that is
|
||||
connection-oriented must be in pop3_conn to properly deal with the fact that
|
||||
perhaps the SessionHandle is changed between the times the connection is
|
||||
perhaps the Curl_easy is changed between the times the connection is
|
||||
used. */
|
||||
struct POP3 {
|
||||
curl_pp_transfer transfer;
|
||||
|
@ -133,7 +133,7 @@ static char *max5data(curl_off_t bytes, char *max5)
|
||||
int Curl_pgrsDone(struct connectdata *conn)
|
||||
{
|
||||
int rc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
data->progress.lastshow=0;
|
||||
rc = Curl_pgrsUpdate(conn); /* the final (forced) update */
|
||||
if(rc)
|
||||
@ -150,7 +150,7 @@ int Curl_pgrsDone(struct connectdata *conn)
|
||||
}
|
||||
|
||||
/* reset all times except redirect, and reset the known transfer sizes */
|
||||
void Curl_pgrsResetTimesSizes(struct SessionHandle *data)
|
||||
void Curl_pgrsResetTimesSizes(struct Curl_easy *data)
|
||||
{
|
||||
data->progress.t_nslookup = 0.0;
|
||||
data->progress.t_connect = 0.0;
|
||||
@ -161,7 +161,7 @@ void Curl_pgrsResetTimesSizes(struct SessionHandle *data)
|
||||
Curl_pgrsSetUploadSize(data, -1);
|
||||
}
|
||||
|
||||
void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
|
||||
void Curl_pgrsTime(struct Curl_easy *data, timerid timer)
|
||||
{
|
||||
struct timeval now = Curl_tvnow();
|
||||
|
||||
@ -212,7 +212,7 @@ void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
|
||||
}
|
||||
}
|
||||
|
||||
void Curl_pgrsStartNow(struct SessionHandle *data)
|
||||
void Curl_pgrsStartNow(struct Curl_easy *data)
|
||||
{
|
||||
data->progress.speeder_c = 0; /* reset the progress meter display */
|
||||
data->progress.start = Curl_tvnow();
|
||||
@ -220,17 +220,17 @@ void Curl_pgrsStartNow(struct SessionHandle *data)
|
||||
data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT;
|
||||
}
|
||||
|
||||
void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size)
|
||||
void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
|
||||
{
|
||||
data->progress.downloaded = size;
|
||||
}
|
||||
|
||||
void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size)
|
||||
void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size)
|
||||
{
|
||||
data->progress.uploaded = size;
|
||||
}
|
||||
|
||||
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size)
|
||||
void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size)
|
||||
{
|
||||
if(size >= 0) {
|
||||
data->progress.size_dl = size;
|
||||
@ -242,7 +242,7 @@ void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size)
|
||||
}
|
||||
}
|
||||
|
||||
void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size)
|
||||
void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size)
|
||||
{
|
||||
if(size >= 0) {
|
||||
data->progress.size_ul = size;
|
||||
@ -269,7 +269,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
|
||||
curl_off_t total_transfer;
|
||||
curl_off_t total_expected_transfer;
|
||||
curl_off_t timespent;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
int nowindex = data->progress.speeder_c% CURR_TIME;
|
||||
int checkindex;
|
||||
int countindex; /* amount of seconds stored in the speeder array */
|
||||
|
@ -41,14 +41,14 @@ typedef enum {
|
||||
} timerid;
|
||||
|
||||
int Curl_pgrsDone(struct connectdata *);
|
||||
void Curl_pgrsStartNow(struct SessionHandle *data);
|
||||
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size);
|
||||
void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size);
|
||||
void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size);
|
||||
void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size);
|
||||
void Curl_pgrsStartNow(struct Curl_easy *data);
|
||||
void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
|
||||
void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
|
||||
void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
|
||||
void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
|
||||
int Curl_pgrsUpdate(struct connectdata *);
|
||||
void Curl_pgrsResetTimesSizes(struct SessionHandle *data);
|
||||
void Curl_pgrsTime(struct SessionHandle *data, timerid timer);
|
||||
void Curl_pgrsResetTimesSizes(struct Curl_easy *data);
|
||||
void Curl_pgrsTime(struct Curl_easy *data, timerid timer);
|
||||
|
||||
|
||||
/* Don't show progress for sizes smaller than: */
|
||||
|
16
lib/rtsp.c
16
lib/rtsp.c
@ -73,7 +73,7 @@ static int rtsp_getsock_do(struct connectdata *conn,
|
||||
* data is parsed and k->str is moved up
|
||||
* readmore: whether or not the RTP parser needs more data right away
|
||||
*/
|
||||
static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
|
||||
static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
ssize_t *nread,
|
||||
bool *readmore);
|
||||
@ -158,7 +158,7 @@ bool Curl_rtsp_connisdead(struct connectdata *check)
|
||||
}
|
||||
else if((sval & CURL_CSELECT_IN) && check->data) {
|
||||
/* readable with no error. could be closed or could be alive but we can
|
||||
only check if we have a proper SessionHandle for the connection */
|
||||
only check if we have a proper Curl_easy for the connection */
|
||||
curl_socket_t connectinfo = Curl_getconnectinfo(check->data, &check);
|
||||
if(connectinfo != CURL_SOCKET_BAD)
|
||||
ret_val = FALSE;
|
||||
@ -170,7 +170,7 @@ bool Curl_rtsp_connisdead(struct connectdata *check)
|
||||
static CURLcode rtsp_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
CURLcode httpStatus;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
httpStatus = Curl_http_connect(conn, done);
|
||||
|
||||
@ -196,7 +196,7 @@ static CURLcode rtsp_disconnect(struct connectdata *conn, bool dead)
|
||||
static CURLcode rtsp_done(struct connectdata *conn,
|
||||
CURLcode status, bool premature)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct RTSP *rtsp = data->req.protop;
|
||||
CURLcode httpStatus;
|
||||
long CSeq_sent;
|
||||
@ -230,7 +230,7 @@ static CURLcode rtsp_done(struct connectdata *conn,
|
||||
|
||||
static CURLcode rtsp_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result=CURLE_OK;
|
||||
Curl_RtspReq rtspreq = data->set.rtspreq;
|
||||
struct RTSP *rtsp = data->req.protop;
|
||||
@ -600,7 +600,7 @@ static CURLcode rtsp_do(struct connectdata *conn, bool *done)
|
||||
}
|
||||
|
||||
|
||||
static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
|
||||
static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
ssize_t *nread,
|
||||
bool *readmore) {
|
||||
@ -731,7 +731,7 @@ static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
|
||||
static
|
||||
CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
size_t wrote;
|
||||
curl_write_callback writeit;
|
||||
|
||||
@ -759,7 +759,7 @@ CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len)
|
||||
CURLcode Curl_rtsp_parseheader(struct connectdata *conn,
|
||||
char *header)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
long CSeq = 0;
|
||||
|
||||
if(checkprefix("CSeq:", header)) {
|
||||
|
@ -476,7 +476,7 @@ Curl_sec_request_prot(struct connectdata *conn, const char *level)
|
||||
static CURLcode choose_mech(struct connectdata *conn)
|
||||
{
|
||||
int ret;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
void *tmp_allocation;
|
||||
const struct Curl_sec_client_mech *mech = &Curl_krb5_client_mech;
|
||||
|
||||
|
18
lib/sendf.c
18
lib/sendf.c
@ -46,7 +46,7 @@
|
||||
* blocks of data. Remaining, bare CRs are changed to LFs. The possibly new
|
||||
* size of the data is returned.
|
||||
*/
|
||||
static size_t convert_lineends(struct SessionHandle *data,
|
||||
static size_t convert_lineends(struct Curl_easy *data,
|
||||
char *startPtr, size_t size)
|
||||
{
|
||||
char *inPtr, *outPtr;
|
||||
@ -207,7 +207,7 @@ static ssize_t get_pre_recved(struct connectdata *conn, int num, char *buf,
|
||||
|
||||
/* Curl_infof() is for info message along the way */
|
||||
|
||||
void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
|
||||
void Curl_infof(struct Curl_easy *data, const char *fmt, ...)
|
||||
{
|
||||
if(data && data->set.verbose) {
|
||||
va_list ap;
|
||||
@ -225,7 +225,7 @@ void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
|
||||
* The message SHALL NOT include any LF or CR.
|
||||
*/
|
||||
|
||||
void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
|
||||
void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
size_t len;
|
||||
@ -253,7 +253,7 @@ void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
|
||||
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
ssize_t bytes_written;
|
||||
size_t write_len;
|
||||
CURLcode result = CURLE_OK;
|
||||
@ -452,7 +452,7 @@ ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf,
|
||||
return nread;
|
||||
}
|
||||
|
||||
static CURLcode pausewrite(struct SessionHandle *data,
|
||||
static CURLcode pausewrite(struct Curl_easy *data,
|
||||
int type, /* what type of data */
|
||||
const char *ptr,
|
||||
size_t len)
|
||||
@ -491,7 +491,7 @@ CURLcode Curl_client_chop_write(struct connectdata *conn,
|
||||
char * ptr,
|
||||
size_t len)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_write_callback writeheader = NULL;
|
||||
curl_write_callback writebody = NULL;
|
||||
|
||||
@ -598,7 +598,7 @@ CURLcode Curl_client_write(struct connectdata *conn,
|
||||
char *ptr,
|
||||
size_t len)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(0 == len)
|
||||
len = strlen(ptr);
|
||||
@ -718,7 +718,7 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */
|
||||
}
|
||||
|
||||
/* return 0 on success */
|
||||
static int showit(struct SessionHandle *data, curl_infotype type,
|
||||
static int showit(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size)
|
||||
{
|
||||
static const char s_infotype[CURLINFO_END][3] = {
|
||||
@ -787,7 +787,7 @@ static int showit(struct SessionHandle *data, curl_infotype type,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Curl_debug(struct SessionHandle *data, curl_infotype type,
|
||||
int Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
|
||||
const char *fmt, ...);
|
||||
void Curl_infof(struct SessionHandle *, const char *fmt, ...);
|
||||
void Curl_failf(struct SessionHandle *, const char *fmt, ...);
|
||||
void Curl_infof(struct Curl_easy *, const char *fmt, ...);
|
||||
void Curl_failf(struct Curl_easy *, const char *fmt, ...);
|
||||
|
||||
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
|
||||
@ -84,7 +84,7 @@ CURLcode Curl_write_plain(struct connectdata *conn,
|
||||
ssize_t *written);
|
||||
|
||||
/* the function used to output verbose information */
|
||||
int Curl_debug(struct SessionHandle *handle, curl_infotype type,
|
||||
int Curl_debug(struct Curl_easy *handle, curl_infotype type,
|
||||
char *data, size_t size,
|
||||
struct connectdata *conn);
|
||||
|
||||
|
@ -213,7 +213,7 @@ curl_share_cleanup(CURLSH *sh)
|
||||
|
||||
|
||||
CURLSHcode
|
||||
Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
|
||||
Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
|
||||
curl_lock_access accesstype)
|
||||
{
|
||||
struct Curl_share *share = data->share;
|
||||
@ -231,7 +231,7 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
|
||||
}
|
||||
|
||||
CURLSHcode
|
||||
Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
|
||||
Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
|
||||
{
|
||||
struct Curl_share *share = data->share;
|
||||
|
||||
|
@ -54,8 +54,8 @@ struct Curl_share {
|
||||
long sessionage;
|
||||
};
|
||||
|
||||
CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data,
|
||||
CURLSHcode Curl_share_lock (struct Curl_easy *, curl_lock_data,
|
||||
curl_lock_access);
|
||||
CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data);
|
||||
CURLSHcode Curl_share_unlock (struct Curl_easy *, curl_lock_data);
|
||||
|
||||
#endif /* HEADER_CURL_SHARE_H */
|
||||
|
@ -38,10 +38,10 @@ struct sigpipe_ignore {
|
||||
* internals, and then sigpipe_restore() will restore the situation when we
|
||||
* return from libcurl again.
|
||||
*/
|
||||
static void sigpipe_ignore(struct SessionHandle *data,
|
||||
static void sigpipe_ignore(struct Curl_easy *data,
|
||||
struct sigpipe_ignore *ig)
|
||||
{
|
||||
/* get a local copy of no_signal because the SessionHandle might not be
|
||||
/* get a local copy of no_signal because the Curl_easy might not be
|
||||
around when we restore */
|
||||
ig->no_signal = data->set.no_signal;
|
||||
if(!data->set.no_signal) {
|
||||
|
@ -930,7 +930,7 @@ static int smb_getsock(struct connectdata *conn, curl_socket_t *socks,
|
||||
static CURLcode smb_parse_url_path(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct smb_request *req = data->req.protop;
|
||||
char *path;
|
||||
char *slash;
|
||||
|
44
lib/smtp.c
44
lib/smtp.c
@ -520,7 +520,7 @@ static CURLcode smtp_perform_authentication(struct connectdata *conn)
|
||||
static CURLcode smtp_perform_command(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
|
||||
/* Send the command */
|
||||
@ -552,7 +552,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
|
||||
char *auth = NULL;
|
||||
char *size = NULL;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Calculate the FROM parameter */
|
||||
if(!data->set.str[STRING_MAIL_FROM])
|
||||
@ -627,7 +627,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
|
||||
static CURLcode smtp_perform_rcpt_to(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
|
||||
/* Send the RCPT TO command */
|
||||
@ -668,7 +668,7 @@ static CURLcode smtp_state_servergreet_resp(struct connectdata *conn,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -688,7 +688,7 @@ static CURLcode smtp_state_starttls_resp(struct connectdata *conn,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -711,7 +711,7 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct smtp_conn *smtpc = &conn->proto.smtpc;
|
||||
const char *line = data->state.buffer;
|
||||
size_t len = strlen(line);
|
||||
@ -806,7 +806,7 @@ static CURLcode smtp_state_helo_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -827,7 +827,7 @@ static CURLcode smtp_state_auth_resp(struct connectdata *conn,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct smtp_conn *smtpc = &conn->proto.smtpc;
|
||||
saslprogress progress;
|
||||
|
||||
@ -855,7 +855,7 @@ static CURLcode smtp_state_command_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
char *line = data->state.buffer;
|
||||
size_t len = strlen(line);
|
||||
@ -901,7 +901,7 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -921,7 +921,7 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
@ -953,7 +953,7 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
|
||||
smtpstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
(void)instate; /* no use for this yet */
|
||||
|
||||
@ -998,7 +998,7 @@ static CURLcode smtp_statemach_act(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
curl_socket_t sock = conn->sock[FIRSTSOCKET];
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
int smtpcode;
|
||||
struct smtp_conn *smtpc = &conn->proto.smtpc;
|
||||
struct pingpong *pp = &smtpc->pp;
|
||||
@ -1108,12 +1108,12 @@ static CURLcode smtp_block_statemach(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Allocate and initialize the SMTP struct for the current SessionHandle if
|
||||
/* Allocate and initialize the SMTP struct for the current Curl_easy if
|
||||
required */
|
||||
static CURLcode smtp_init(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp;
|
||||
|
||||
smtp = data->req.protop = calloc(sizeof(struct SMTP), 1);
|
||||
@ -1194,7 +1194,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
struct pingpong *pp = &conn->proto.smtpc.pp;
|
||||
char *eob;
|
||||
@ -1284,7 +1284,7 @@ static CURLcode smtp_perform(struct connectdata *conn, bool *connected,
|
||||
{
|
||||
/* This is SMTP and no proxy */
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
|
||||
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
||||
@ -1423,7 +1423,7 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn,
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
bool connected = FALSE;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* Make sure size is unknown at this point */
|
||||
data->req.size = -1;
|
||||
@ -1446,7 +1446,7 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn,
|
||||
|
||||
static CURLcode smtp_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode result;
|
||||
|
||||
/* Clear the TLS upgraded flag */
|
||||
@ -1534,7 +1534,7 @@ static CURLcode smtp_parse_url_options(struct connectdata *conn)
|
||||
static CURLcode smtp_parse_url_path(struct connectdata *conn)
|
||||
{
|
||||
/* The SMTP struct is already initialised in smtp_connect() */
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct smtp_conn *smtpc = &conn->proto.smtpc;
|
||||
const char *path = data->state.path;
|
||||
char localhost[HOSTNAME_MAX + 1];
|
||||
@ -1560,7 +1560,7 @@ static CURLcode smtp_parse_url_path(struct connectdata *conn)
|
||||
static CURLcode smtp_parse_custom_request(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
|
||||
|
||||
@ -1581,7 +1581,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
|
||||
*/
|
||||
ssize_t i;
|
||||
ssize_t si;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SMTP *smtp = data->req.protop;
|
||||
char *scratch = data->state.scratch;
|
||||
char *newscratch = NULL;
|
||||
|
@ -47,9 +47,9 @@ typedef enum {
|
||||
SMTP_LAST /* never used */
|
||||
} smtpstate;
|
||||
|
||||
/* This SMTP struct is used in the SessionHandle. All SMTP data that is
|
||||
/* This SMTP struct is used in the Curl_easy. All SMTP data that is
|
||||
connection-oriented must be in smtp_conn to properly deal with the fact that
|
||||
perhaps the SessionHandle is changed between the times the connection is
|
||||
perhaps the Curl_easy is changed between the times the connection is
|
||||
used. */
|
||||
struct SMTP {
|
||||
curl_pp_transfer transfer;
|
||||
|
@ -119,7 +119,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
|
||||
int result;
|
||||
CURLcode code;
|
||||
curl_socket_t sock = conn->sock[sockindex];
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(Curl_timeleft(data, NULL, TRUE) < 0) {
|
||||
/* time-out, bail out, go home */
|
||||
@ -374,7 +374,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
|
||||
int result;
|
||||
CURLcode code;
|
||||
curl_socket_t sock = conn->sock[sockindex];
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
long timeout;
|
||||
bool socks5_resolve_local = (conn->proxytype == CURLPROXY_SOCKS5)?TRUE:FALSE;
|
||||
const size_t hostname_len = strlen(hostname);
|
||||
|
@ -43,7 +43,7 @@ static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
|
||||
/*
|
||||
* Helper GSS-API error functions.
|
||||
*/
|
||||
static int check_gss_err(struct SessionHandle *data,
|
||||
static int check_gss_err(struct Curl_easy *data,
|
||||
OM_uint32 major_status,
|
||||
OM_uint32 minor_status,
|
||||
const char* function)
|
||||
@ -102,7 +102,7 @@ static int check_gss_err(struct SessionHandle *data,
|
||||
CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t sock = conn->sock[sockindex];
|
||||
CURLcode code;
|
||||
ssize_t actualread;
|
||||
|
@ -61,7 +61,7 @@ static int check_sspi_err(struct connectdata *conn,
|
||||
CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t sock = conn->sock[sockindex];
|
||||
CURLcode code;
|
||||
ssize_t actualread;
|
||||
|
@ -28,12 +28,12 @@
|
||||
#include "multiif.h"
|
||||
#include "speedcheck.h"
|
||||
|
||||
void Curl_speedinit(struct SessionHandle *data)
|
||||
void Curl_speedinit(struct Curl_easy *data)
|
||||
{
|
||||
memset(&data->state.keeps_speed, 0, sizeof(struct timeval));
|
||||
}
|
||||
|
||||
CURLcode Curl_speedcheck(struct SessionHandle *data,
|
||||
CURLcode Curl_speedcheck(struct Curl_easy *data,
|
||||
struct timeval now)
|
||||
{
|
||||
if((data->progress.current_speed >= 0) &&
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
#include "timeval.h"
|
||||
|
||||
void Curl_speedinit(struct SessionHandle *data);
|
||||
CURLcode Curl_speedcheck(struct SessionHandle *data,
|
||||
void Curl_speedinit(struct Curl_easy *data);
|
||||
CURLcode Curl_speedcheck(struct Curl_easy *data,
|
||||
struct timeval now);
|
||||
|
||||
#endif /* HEADER_CURL_SPEEDCHECK_H */
|
||||
|
14
lib/ssh.c
14
lib/ssh.c
@ -413,7 +413,7 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
|
||||
char **path) /* returns the allocated
|
||||
real path to work with */
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char *real_path = NULL;
|
||||
char *working_path;
|
||||
int working_path_len;
|
||||
@ -522,7 +522,7 @@ static CURLcode ssh_knownhost(struct connectdata *conn)
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
#ifdef HAVE_LIBSSH2_KNOWNHOST_API
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
if(data->set.str[STRING_SSH_KNOWNHOSTS]) {
|
||||
/* we're asked to verify the host against a file */
|
||||
@ -657,7 +657,7 @@ static CURLcode ssh_knownhost(struct connectdata *conn)
|
||||
static CURLcode ssh_check_fingerprint(struct connectdata *conn)
|
||||
{
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
const char *pubkey_md5 = data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5];
|
||||
char md5buffer[33];
|
||||
int i;
|
||||
@ -708,7 +708,7 @@ static CURLcode ssh_check_fingerprint(struct connectdata *conn)
|
||||
static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct SSHPROTO *sftp_scp = data->req.protop;
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
curl_socket_t sock = conn->sock[FIRSTSOCKET];
|
||||
@ -2819,7 +2819,7 @@ static CURLcode ssh_block_statemach(struct connectdata *conn,
|
||||
{
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
while((sshc->state != SSH_STOP) && !result) {
|
||||
bool block;
|
||||
@ -2893,7 +2893,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
|
||||
#endif
|
||||
struct ssh_conn *ssh;
|
||||
CURLcode result;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* initialize per-handle data if not already */
|
||||
if(!data->req.protop)
|
||||
@ -3019,7 +3019,7 @@ static CURLcode ssh_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
CURLcode result;
|
||||
bool connected = 0;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
|
||||
*done = FALSE; /* default to false */
|
||||
|
@ -98,7 +98,7 @@ typedef enum {
|
||||
} sshstate;
|
||||
|
||||
/* this struct is used in the HandleData struct which is part of the
|
||||
SessionHandle, which means this is used on a per-easy handle basis.
|
||||
Curl_easy, which means this is used on a per-easy handle basis.
|
||||
Everything that is strictly related to a connection is banned from this
|
||||
struct. */
|
||||
struct SSHPROTO {
|
||||
|
24
lib/telnet.c
24
lib/telnet.c
@ -92,7 +92,7 @@
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
typedef FARPROC WSOCK2_FUNC;
|
||||
static CURLcode check_wsock2 (struct SessionHandle *data);
|
||||
static CURLcode check_wsock2 (struct Curl_easy *data);
|
||||
#endif
|
||||
|
||||
static
|
||||
@ -101,7 +101,7 @@ CURLcode telrcv(struct connectdata *,
|
||||
ssize_t count); /* Number of bytes received */
|
||||
|
||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
||||
static void printoption(struct SessionHandle *data,
|
||||
static void printoption(struct Curl_easy *data,
|
||||
const char *direction,
|
||||
int cmd, int option);
|
||||
#endif
|
||||
@ -111,7 +111,7 @@ static void send_negotiation(struct connectdata *, int cmd, int option);
|
||||
static void set_local_option(struct connectdata *, int cmd, int option);
|
||||
static void set_remote_option(struct connectdata *, int cmd, int option);
|
||||
|
||||
static void printsub(struct SessionHandle *data,
|
||||
static void printsub(struct Curl_easy *data,
|
||||
int direction, unsigned char *pointer,
|
||||
size_t length);
|
||||
static void suboption(struct connectdata *);
|
||||
@ -199,7 +199,7 @@ const struct Curl_handler Curl_handler_telnet = {
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
static CURLcode
|
||||
check_wsock2(struct SessionHandle *data)
|
||||
check_wsock2(struct Curl_easy *data)
|
||||
{
|
||||
int err;
|
||||
WORD wVersionRequested;
|
||||
@ -306,7 +306,7 @@ static void negotiate(struct connectdata *conn)
|
||||
}
|
||||
|
||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
||||
static void printoption(struct SessionHandle *data,
|
||||
static void printoption(struct Curl_easy *data,
|
||||
const char *direction, int cmd, int option)
|
||||
{
|
||||
const char *fmt;
|
||||
@ -347,7 +347,7 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option)
|
||||
unsigned char buf[3];
|
||||
ssize_t bytes_written;
|
||||
int err;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
buf[0] = CURL_IAC;
|
||||
buf[1] = (unsigned char)cmd;
|
||||
@ -703,7 +703,7 @@ void rec_dont(struct connectdata *conn, int option)
|
||||
}
|
||||
|
||||
|
||||
static void printsub(struct SessionHandle *data,
|
||||
static void printsub(struct Curl_easy *data,
|
||||
int direction, /* '<' or '>' */
|
||||
unsigned char *pointer, /* where suboption data is */
|
||||
size_t length) /* length of suboption data */
|
||||
@ -822,7 +822,7 @@ static CURLcode check_telnet_options(struct connectdata *conn)
|
||||
struct curl_slist *beg;
|
||||
char option_keyword[128] = "";
|
||||
char option_arg[256] = "";
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct TELNET *tn = (struct TELNET *)conn->data->req.protop;
|
||||
CURLcode result = CURLE_OK;
|
||||
int binary_option;
|
||||
@ -932,7 +932,7 @@ static void suboption(struct connectdata *conn)
|
||||
int err;
|
||||
char varname[128] = "";
|
||||
char varval[128] = "";
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
||||
|
||||
printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn)+2);
|
||||
@ -1007,7 +1007,7 @@ static void sendsuboption(struct connectdata *conn, int option)
|
||||
unsigned short x, y;
|
||||
unsigned char*uc1, *uc2;
|
||||
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
||||
|
||||
switch (option) {
|
||||
@ -1065,7 +1065,7 @@ CURLcode telrcv(struct connectdata *conn,
|
||||
CURLcode result;
|
||||
int in = 0;
|
||||
int startwrite=-1;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
||||
|
||||
#define startskipping() \
|
||||
@ -1282,7 +1282,7 @@ static CURLcode telnet_done(struct connectdata *conn,
|
||||
static CURLcode telnet_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
CURLcode result;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
#ifdef USE_WINSOCK
|
||||
HMODULE wsock2;
|
||||
|
20
lib/tftp.c
20
lib/tftp.c
@ -333,7 +333,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
||||
const char *ptr, int len)
|
||||
{
|
||||
const char *tmp = ptr;
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
|
||||
/* if OACK doesn't contain blksize option, the default (512) must be used */
|
||||
state->blksize = TFTP_BLKSIZE_DEFAULT;
|
||||
@ -416,7 +416,7 @@ static CURLcode tftp_connect_for_tx(tftp_state_data_t *state,
|
||||
{
|
||||
CURLcode result;
|
||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
|
||||
infof(data, "%s\n", "Connected for transmit");
|
||||
#endif
|
||||
@ -432,7 +432,7 @@ static CURLcode tftp_connect_for_rx(tftp_state_data_t *state,
|
||||
{
|
||||
CURLcode result;
|
||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
|
||||
infof(data, "%s\n", "Connected for receive");
|
||||
#endif
|
||||
@ -450,7 +450,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
||||
const char *mode = "octet";
|
||||
char *filename;
|
||||
char buf[64];
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
/* Set ascii mode if -B flag was used */
|
||||
@ -581,7 +581,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
||||
{
|
||||
ssize_t sbytes;
|
||||
int rblock;
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
|
||||
switch(event) {
|
||||
|
||||
@ -700,7 +700,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
||||
**********************************************************/
|
||||
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
||||
{
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
ssize_t sbytes;
|
||||
int rblock;
|
||||
CURLcode result = CURLE_OK;
|
||||
@ -889,7 +889,7 @@ static CURLcode tftp_state_machine(tftp_state_data_t *state,
|
||||
tftp_event_t event)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = state->conn->data;
|
||||
struct Curl_easy *data = state->conn->data;
|
||||
|
||||
switch(state->state) {
|
||||
case TFTP_STATE_START:
|
||||
@ -1081,7 +1081,7 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
||||
struct Curl_sockaddr_storage fromaddr;
|
||||
curl_socklen_t fromlen;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
|
||||
struct SingleRequest *k = &data->req;
|
||||
|
||||
@ -1200,7 +1200,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
|
||||
int rc;
|
||||
tftp_event_t event;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
|
||||
long timeout_ms = tftp_state_timeout(conn, &event);
|
||||
|
||||
@ -1342,7 +1342,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
|
||||
|
||||
static CURLcode tftp_setup_connection(struct connectdata * conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
char * type;
|
||||
char command;
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
||||
*/
|
||||
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
size_t buffersize = (size_t)bytes;
|
||||
int nread;
|
||||
#ifdef CURL_DOES_CONVERSIONS
|
||||
@ -242,7 +242,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
|
||||
*/
|
||||
CURLcode Curl_readrewind(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
conn->bits.rewindaftersend = FALSE; /* we rewind now */
|
||||
|
||||
@ -352,7 +352,7 @@ static void read_rewind(struct connectdata *conn,
|
||||
* Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the
|
||||
* remote document with the time provided by CURLOPT_TIMEVAL
|
||||
*/
|
||||
bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
|
||||
bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc)
|
||||
{
|
||||
if((timeofdoc == 0) || (data->set.timevalue == 0))
|
||||
return TRUE;
|
||||
@ -385,7 +385,7 @@ bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
|
||||
* the stream was rewound (in which case we have data in a
|
||||
* buffer)
|
||||
*/
|
||||
static CURLcode readwrite_data(struct SessionHandle *data,
|
||||
static CURLcode readwrite_data(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
struct SingleRequest *k,
|
||||
int *didwhat, bool *done)
|
||||
@ -833,7 +833,7 @@ static CURLcode done_sending(struct connectdata *conn,
|
||||
/*
|
||||
* Send data to upload to the server, when the socket is writable.
|
||||
*/
|
||||
static CURLcode readwrite_upload(struct SessionHandle *data,
|
||||
static CURLcode readwrite_upload(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
struct SingleRequest *k,
|
||||
int *didwhat)
|
||||
@ -1031,7 +1031,7 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
|
||||
* be read and written to/from the connection.
|
||||
*/
|
||||
CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
struct SessionHandle *data,
|
||||
struct Curl_easy *data,
|
||||
bool *done)
|
||||
{
|
||||
struct SingleRequest *k = &data->req;
|
||||
@ -1208,7 +1208,7 @@ int Curl_single_getsock(const struct connectdata *conn,
|
||||
of sockets */
|
||||
int numsocks)
|
||||
{
|
||||
const struct SessionHandle *data = conn->data;
|
||||
const struct Curl_easy *data = conn->data;
|
||||
int bitmap = GETSOCK_BLANK;
|
||||
unsigned sockindex = 0;
|
||||
|
||||
@ -1305,7 +1305,7 @@ long Curl_sleep_time(curl_off_t rate_bps, curl_off_t cur_rate_bps,
|
||||
|
||||
/* Curl_init_CONNECT() gets called each time the handle switches to CONNECT
|
||||
which means this gets called once for each subsequent redirect etc */
|
||||
void Curl_init_CONNECT(struct SessionHandle *data)
|
||||
void Curl_init_CONNECT(struct Curl_easy *data)
|
||||
{
|
||||
data->state.fread_func = data->set.fread_func_set;
|
||||
data->state.in = data->set.in_set;
|
||||
@ -1316,7 +1316,7 @@ void Curl_init_CONNECT(struct SessionHandle *data)
|
||||
* once for one transfer no matter if it has redirects or do multi-pass
|
||||
* authentication etc.
|
||||
*/
|
||||
CURLcode Curl_pretransfer(struct SessionHandle *data)
|
||||
CURLcode Curl_pretransfer(struct Curl_easy *data)
|
||||
{
|
||||
CURLcode result;
|
||||
if(!data->change.url) {
|
||||
@ -1403,7 +1403,7 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
|
||||
/*
|
||||
* Curl_posttransfer() is called immediately after a transfer ends
|
||||
*/
|
||||
CURLcode Curl_posttransfer(struct SessionHandle *data)
|
||||
CURLcode Curl_posttransfer(struct Curl_easy *data)
|
||||
{
|
||||
#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL)
|
||||
/* restore the signal handler for SIGPIPE before we get back */
|
||||
@ -1660,7 +1660,7 @@ static char *concat_url(const char *base, const char *relurl)
|
||||
* Curl_follow() handles the URL redirect magic. Pass in the 'newurl' string
|
||||
* as given by the remote server and set up the new URL to request.
|
||||
*/
|
||||
CURLcode Curl_follow(struct SessionHandle *data,
|
||||
CURLcode Curl_follow(struct Curl_easy *data,
|
||||
char *newurl, /* this 'newurl' is the Location: string,
|
||||
and it must be malloc()ed before passed
|
||||
here */
|
||||
@ -1864,7 +1864,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
|
||||
CURLcode Curl_retry_request(struct connectdata *conn,
|
||||
char **url)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
*url = NULL;
|
||||
|
||||
@ -1920,7 +1920,7 @@ Curl_setup_transfer(
|
||||
curl_off_t *writecountp /* return number of bytes written or NULL */
|
||||
)
|
||||
{
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
struct SingleRequest *k;
|
||||
|
||||
DEBUGASSERT(conn != NULL);
|
||||
|
@ -22,11 +22,11 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
void Curl_init_CONNECT(struct SessionHandle *data);
|
||||
void Curl_init_CONNECT(struct Curl_easy *data);
|
||||
|
||||
CURLcode Curl_pretransfer(struct SessionHandle *data);
|
||||
CURLcode Curl_pretransfer(struct Curl_easy *data);
|
||||
CURLcode Curl_second_connect(struct connectdata *conn);
|
||||
CURLcode Curl_posttransfer(struct SessionHandle *data);
|
||||
CURLcode Curl_posttransfer(struct Curl_easy *data);
|
||||
|
||||
typedef enum {
|
||||
FOLLOW_NONE, /* not used within the function, just a placeholder to
|
||||
@ -38,19 +38,19 @@ typedef enum {
|
||||
FOLLOW_LAST /* never used */
|
||||
} followtype;
|
||||
|
||||
CURLcode Curl_follow(struct SessionHandle *data, char *newurl,
|
||||
CURLcode Curl_follow(struct Curl_easy *data, char *newurl,
|
||||
followtype type);
|
||||
|
||||
|
||||
CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
struct SessionHandle *data, bool *done);
|
||||
struct Curl_easy *data, bool *done);
|
||||
int Curl_single_getsock(const struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks);
|
||||
CURLcode Curl_readrewind(struct connectdata *conn);
|
||||
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp);
|
||||
CURLcode Curl_retry_request(struct connectdata *conn, char **url);
|
||||
bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc);
|
||||
bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc);
|
||||
|
||||
/* This sets up a forthcoming transfer */
|
||||
void
|
||||
|
114
lib/url.c
114
lib/url.c
@ -137,12 +137,12 @@ bool curl_win32_idn_to_ascii(const char *in, char **out);
|
||||
|
||||
/* Local static prototypes */
|
||||
static struct connectdata *
|
||||
find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
|
||||
find_oldest_idle_connection_in_bundle(struct Curl_easy *data,
|
||||
struct connectbundle *bundle);
|
||||
static void conn_free(struct connectdata *conn);
|
||||
static void free_fixed_hostname(struct hostname *host);
|
||||
static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke);
|
||||
static CURLcode parse_url_login(struct SessionHandle *data,
|
||||
static CURLcode parse_url_login(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
char **userptr, char **passwdptr,
|
||||
char **optionsptr);
|
||||
@ -277,7 +277,7 @@ static const struct Curl_handler Curl_handler_dummy = {
|
||||
PROTOPT_NONE /* flags */
|
||||
};
|
||||
|
||||
void Curl_freeset(struct SessionHandle *data)
|
||||
void Curl_freeset(struct Curl_easy *data)
|
||||
{
|
||||
/* Free all dynamic strings stored in the data->set substructure. */
|
||||
enum dupstring i;
|
||||
@ -355,7 +355,7 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp)
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src)
|
||||
CURLcode Curl_dupset(struct Curl_easy *dst, struct Curl_easy *src)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
enum dupstring i;
|
||||
@ -398,7 +398,7 @@ CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src)
|
||||
* when curl_easy_perform() is invoked.
|
||||
*/
|
||||
|
||||
CURLcode Curl_close(struct SessionHandle *data)
|
||||
CURLcode Curl_close(struct Curl_easy *data)
|
||||
{
|
||||
struct Curl_multi *m;
|
||||
|
||||
@ -496,8 +496,8 @@ CURLcode Curl_close(struct SessionHandle *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the UserDefined fields within a SessionHandle.
|
||||
* This may be safely called on a new or existing SessionHandle.
|
||||
* Initialize the UserDefined fields within a Curl_easy.
|
||||
* This may be safely called on a new or existing Curl_easy.
|
||||
*/
|
||||
CURLcode Curl_init_userdefined(struct UserDefined *set)
|
||||
{
|
||||
@ -621,16 +621,16 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
|
||||
* @return CURLcode
|
||||
*/
|
||||
|
||||
CURLcode Curl_open(struct SessionHandle **curl)
|
||||
CURLcode Curl_open(struct Curl_easy **curl)
|
||||
{
|
||||
CURLcode result;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
|
||||
/* Very simple start-up: alloc the struct, init it with zeroes and return */
|
||||
data = calloc(1, sizeof(struct SessionHandle));
|
||||
data = calloc(1, sizeof(struct Curl_easy));
|
||||
if(!data) {
|
||||
/* this is a very serious error */
|
||||
DEBUGF(fprintf(stderr, "Error: calloc of SessionHandle failed\n"));
|
||||
DEBUGF(fprintf(stderr, "Error: calloc of Curl_easy failed\n"));
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -684,7 +684,7 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
va_list param)
|
||||
{
|
||||
char *argptr;
|
||||
@ -2684,7 +2684,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
#ifndef USE_NGHTTP2
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#else
|
||||
struct SessionHandle *dep = va_arg(param, struct SessionHandle *);
|
||||
struct Curl_easy *dep = va_arg(param, struct Curl_easy *);
|
||||
if(dep && GOOD_EASY_HANDLE(dep)) {
|
||||
data->set.stream_depends_on = dep;
|
||||
data->set.stream_depends_e = (option == CURLOPT_STREAM_DEPENDS_E);
|
||||
@ -2812,14 +2812,14 @@ static void conn_free(struct connectdata *conn)
|
||||
* primary connection, like when freeing room in the connection cache or
|
||||
* killing of a dead old connection.
|
||||
*
|
||||
* This function MUST NOT reset state in the SessionHandle struct if that
|
||||
* This function MUST NOT reset state in the Curl_easy struct if that
|
||||
* isn't strictly bound to the life-time of *this* particular connection.
|
||||
*
|
||||
*/
|
||||
|
||||
CURLcode Curl_disconnect(struct connectdata *conn, bool dead_connection)
|
||||
{
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
if(!conn)
|
||||
return CURLE_OK; /* this is closed and fine already */
|
||||
data = conn->data;
|
||||
@ -2888,7 +2888,7 @@ static bool SocketIsDead(curl_socket_t sock)
|
||||
* IsPipeliningPossible() returns TRUE if the options set would allow
|
||||
* pipelining/multiplexing and the connection is using a HTTP protocol.
|
||||
*/
|
||||
static bool IsPipeliningPossible(const struct SessionHandle *handle,
|
||||
static bool IsPipeliningPossible(const struct Curl_easy *handle,
|
||||
const struct connectdata *conn)
|
||||
{
|
||||
/* If a HTTP protocol and pipelining is enabled */
|
||||
@ -2909,7 +2909,7 @@ static bool IsPipeliningPossible(const struct SessionHandle *handle,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
|
||||
int Curl_removeHandleFromPipeline(struct Curl_easy *handle,
|
||||
struct curl_llist *pipeline)
|
||||
{
|
||||
if(pipeline) {
|
||||
@ -2935,18 +2935,18 @@ static void Curl_printPipeline(struct curl_llist *pipeline)
|
||||
|
||||
curr = pipeline->head;
|
||||
while(curr) {
|
||||
struct SessionHandle *data = (struct SessionHandle *) curr->ptr;
|
||||
struct Curl_easy *data = (struct Curl_easy *) curr->ptr;
|
||||
infof(data, "Handle in pipeline: %s\n", data->state.path);
|
||||
curr = curr->next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
|
||||
static struct Curl_easy* gethandleathead(struct curl_llist *pipeline)
|
||||
{
|
||||
struct curl_llist_element *curr = pipeline->head;
|
||||
if(curr) {
|
||||
return (struct SessionHandle *) curr->ptr;
|
||||
return (struct Curl_easy *) curr->ptr;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -2954,7 +2954,7 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
|
||||
|
||||
/* remove the specified connection from all (possible) pipelines and related
|
||||
queues */
|
||||
void Curl_getoff_all_pipelines(struct SessionHandle *data,
|
||||
void Curl_getoff_all_pipelines(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
bool recv_head = (conn->readchannel_inuse &&
|
||||
@ -2978,7 +2978,7 @@ static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke)
|
||||
curr = pipeline->head;
|
||||
while(curr) {
|
||||
struct curl_llist_element *next = curr->next;
|
||||
struct SessionHandle *data = (struct SessionHandle *) curr->ptr;
|
||||
struct Curl_easy *data = (struct Curl_easy *) curr->ptr;
|
||||
|
||||
#ifdef DEBUGBUILD /* debug-only code */
|
||||
if(data->magic != CURLEASY_MAGIC_NUMBER) {
|
||||
@ -3003,7 +3003,7 @@ static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke)
|
||||
* found.
|
||||
*/
|
||||
struct connectdata *
|
||||
Curl_oldest_idle_connection(struct SessionHandle *data)
|
||||
Curl_oldest_idle_connection(struct Curl_easy *data)
|
||||
{
|
||||
struct conncache *bc = data->state.conn_cache;
|
||||
struct curl_hash_iterator iter;
|
||||
@ -3055,7 +3055,7 @@ Curl_oldest_idle_connection(struct SessionHandle *data)
|
||||
* found.
|
||||
*/
|
||||
static struct connectdata *
|
||||
find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
|
||||
find_oldest_idle_connection_in_bundle(struct Curl_easy *data,
|
||||
struct connectbundle *bundle)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
@ -3095,7 +3095,7 @@ find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
|
||||
* Returns TRUE if the connection actually was dead and disconnected.
|
||||
*/
|
||||
static bool disconnect_if_dead(struct connectdata *conn,
|
||||
struct SessionHandle *data)
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
size_t pipeLen = conn->send_pipe->size + conn->recv_pipe->size;
|
||||
if(!pipeLen && !conn->inuse) {
|
||||
@ -3129,7 +3129,7 @@ static bool disconnect_if_dead(struct connectdata *conn,
|
||||
static int call_disconnect_if_dead(struct connectdata *conn,
|
||||
void *param)
|
||||
{
|
||||
struct SessionHandle* data = (struct SessionHandle*)param;
|
||||
struct Curl_easy* data = (struct Curl_easy*)param;
|
||||
disconnect_if_dead(conn, data);
|
||||
return 0; /* continue iteration */
|
||||
}
|
||||
@ -3139,7 +3139,7 @@ static int call_disconnect_if_dead(struct connectdata *conn,
|
||||
* closes and removes them.
|
||||
* The cleanup is done at most once per second.
|
||||
*/
|
||||
static void prune_dead_connections(struct SessionHandle *data)
|
||||
static void prune_dead_connections(struct Curl_easy *data)
|
||||
{
|
||||
struct timeval now = Curl_tvnow();
|
||||
long elapsed = Curl_tvdiff(now, data->state.conn_cache->last_cleanup);
|
||||
@ -3171,7 +3171,7 @@ static size_t max_pipeline_length(struct Curl_multi *multi)
|
||||
* the pipelining strategy wants to open a new connection instead of reusing.
|
||||
*/
|
||||
static bool
|
||||
ConnectionExists(struct SessionHandle *data,
|
||||
ConnectionExists(struct Curl_easy *data,
|
||||
struct connectdata *needle,
|
||||
struct connectdata **usethis,
|
||||
bool *force_reuse,
|
||||
@ -3270,8 +3270,8 @@ ConnectionExists(struct SessionHandle *data,
|
||||
|
||||
if(!check->bits.multiplex) {
|
||||
/* If not multiplexing, make sure the pipe has only GET requests */
|
||||
struct SessionHandle* sh = gethandleathead(check->send_pipe);
|
||||
struct SessionHandle* rh = gethandleathead(check->recv_pipe);
|
||||
struct Curl_easy* sh = gethandleathead(check->send_pipe);
|
||||
struct Curl_easy* rh = gethandleathead(check->recv_pipe);
|
||||
if(sh) {
|
||||
if(!IsPipeliningPossible(sh, check))
|
||||
continue;
|
||||
@ -3756,7 +3756,7 @@ static bool is_ASCII_name(const char *hostname)
|
||||
/*
|
||||
* Check if characters in hostname is allowed in Top Level Domain.
|
||||
*/
|
||||
static bool tld_check_name(struct SessionHandle *data,
|
||||
static bool tld_check_name(struct Curl_easy *data,
|
||||
const char *ace_hostname)
|
||||
{
|
||||
size_t err_pos;
|
||||
@ -3798,7 +3798,7 @@ static bool tld_check_name(struct SessionHandle *data,
|
||||
/*
|
||||
* Perform any necessary IDN conversion of hostname
|
||||
*/
|
||||
static void fix_hostname(struct SessionHandle *data,
|
||||
static void fix_hostname(struct Curl_easy *data,
|
||||
struct connectdata *conn, struct hostname *host)
|
||||
{
|
||||
size_t len;
|
||||
@ -3887,7 +3887,7 @@ static void llist_dtor(void *user, void *element)
|
||||
/*
|
||||
* Allocate and initialize a new connectdata object.
|
||||
*/
|
||||
static struct connectdata *allocate_conn(struct SessionHandle *data)
|
||||
static struct connectdata *allocate_conn(struct Curl_easy *data)
|
||||
{
|
||||
struct connectdata *conn = calloc(1, sizeof(struct connectdata));
|
||||
if(!conn)
|
||||
@ -3920,7 +3920,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
|
||||
conn->created = Curl_tvnow();
|
||||
|
||||
conn->data = data; /* Setup the association between this connection
|
||||
and the SessionHandle */
|
||||
and the Curl_easy */
|
||||
|
||||
conn->proxytype = data->set.proxytype; /* type */
|
||||
|
||||
@ -3992,7 +3992,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
|
||||
conn->localport = data->set.localport;
|
||||
|
||||
/* the close socket stuff needs to be copied to the connection struct as
|
||||
it may live on without (this specific) SessionHandle */
|
||||
it may live on without (this specific) Curl_easy */
|
||||
conn->fclosesocket = data->set.fclosesocket;
|
||||
conn->closesocket_client = data->set.closesocket_client;
|
||||
|
||||
@ -4011,7 +4011,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static CURLcode findprotocol(struct SessionHandle *data,
|
||||
static CURLcode findprotocol(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
const char *protostr)
|
||||
{
|
||||
@ -4056,7 +4056,7 @@ static CURLcode findprotocol(struct SessionHandle *data,
|
||||
/*
|
||||
* Parse URL and fill in the relevant members of the connection struct.
|
||||
*/
|
||||
static CURLcode parseurlandfillconn(struct SessionHandle *data,
|
||||
static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
bool *prot_missing,
|
||||
char **userp, char **passwdp,
|
||||
@ -4424,7 +4424,7 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
|
||||
* If we're doing a resumed transfer, we need to setup our stuff
|
||||
* properly.
|
||||
*/
|
||||
static CURLcode setup_range(struct SessionHandle *data)
|
||||
static CURLcode setup_range(struct Curl_easy *data)
|
||||
{
|
||||
struct UrlState *s = &data->state;
|
||||
s->resume_from = data->set.set_resume_from;
|
||||
@ -4456,7 +4456,7 @@ static CURLcode setup_range(struct SessionHandle *data)
|
||||
* setup_connection_internals() -
|
||||
*
|
||||
* Setup connection internals specific to the requested protocol in the
|
||||
* SessionHandle. This is inited and setup before the connection is made but
|
||||
* Curl_easy. This is inited and setup before the connection is made but
|
||||
* is about the particular protocol that is to be used.
|
||||
*
|
||||
* This MUST get called after proxy magic has been figured out.
|
||||
@ -4465,7 +4465,7 @@ static CURLcode setup_connection_internals(struct connectdata *conn)
|
||||
{
|
||||
const struct Curl_handler * p;
|
||||
CURLcode result;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
/* in some case in the multi state-machine, we go back to the CONNECT state
|
||||
and then a second (or third or...) call to this function will be made
|
||||
@ -4501,10 +4501,10 @@ static CURLcode setup_connection_internals(struct connectdata *conn)
|
||||
|
||||
/*
|
||||
* Curl_free_request_state() should free temp data that was allocated in the
|
||||
* SessionHandle for this single request.
|
||||
* Curl_easy for this single request.
|
||||
*/
|
||||
|
||||
void Curl_free_request_state(struct SessionHandle *data)
|
||||
void Curl_free_request_state(struct Curl_easy *data)
|
||||
{
|
||||
Curl_safefree(data->req.protop);
|
||||
Curl_safefree(data->req.newurl);
|
||||
@ -4678,7 +4678,7 @@ static char *detect_proxy(struct connectdata *conn)
|
||||
* host name, so that we can re-use an existing connection
|
||||
* that may exist registered to the same proxy host.
|
||||
*/
|
||||
static CURLcode parse_proxy(struct SessionHandle *data,
|
||||
static CURLcode parse_proxy(struct Curl_easy *data,
|
||||
struct connectdata *conn, char *proxy)
|
||||
{
|
||||
char *prox_portno;
|
||||
@ -4841,7 +4841,7 @@ static CURLcode parse_proxy(struct SessionHandle *data,
|
||||
/*
|
||||
* Extract the user and password from the authentication string
|
||||
*/
|
||||
static CURLcode parse_proxy_auth(struct SessionHandle *data,
|
||||
static CURLcode parse_proxy_auth(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
char proxyuser[MAX_CURL_USER_LENGTH]="";
|
||||
@ -4886,7 +4886,7 @@ static CURLcode parse_proxy_auth(struct SessionHandle *data,
|
||||
* options - non-zero length if defined
|
||||
* conn->host.name - remove user name and password
|
||||
*/
|
||||
static CURLcode parse_url_login(struct SessionHandle *data,
|
||||
static CURLcode parse_url_login(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
char **user, char **passwd, char **options)
|
||||
{
|
||||
@ -5125,7 +5125,7 @@ static CURLcode parse_login_details(const char *login, const size_t len,
|
||||
*
|
||||
* The port number embedded in the URL is replaced, if necessary.
|
||||
*************************************************************/
|
||||
static CURLcode parse_remote_port(struct SessionHandle *data,
|
||||
static CURLcode parse_remote_port(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
char *portptr;
|
||||
@ -5237,7 +5237,7 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
|
||||
* Override the login details from the URL with that in the CURLOPT_USERPWD
|
||||
* option or a .netrc file, if applicable.
|
||||
*/
|
||||
static CURLcode override_login(struct SessionHandle *data,
|
||||
static CURLcode override_login(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
char **userp, char **passwdp, char **optionsp)
|
||||
{
|
||||
@ -5340,7 +5340,7 @@ static CURLcode set_login(struct connectdata *conn,
|
||||
* The hostname and the port may be empty; in this case, NULL is returned for
|
||||
* the hostname and -1 for the port.
|
||||
*/
|
||||
static CURLcode parse_connect_to_host_port(struct SessionHandle *data,
|
||||
static CURLcode parse_connect_to_host_port(struct Curl_easy *data,
|
||||
const char *host,
|
||||
char **hostname_result,
|
||||
int *port_result)
|
||||
@ -5431,7 +5431,7 @@ static CURLcode parse_connect_to_host_port(struct SessionHandle *data,
|
||||
* Parses one "connect to" string in the form:
|
||||
* "HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT".
|
||||
*/
|
||||
static CURLcode parse_connect_to_string(struct SessionHandle *data,
|
||||
static CURLcode parse_connect_to_string(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
const char *conn_to_host,
|
||||
char **host_result,
|
||||
@ -5497,7 +5497,7 @@ static CURLcode parse_connect_to_string(struct SessionHandle *data,
|
||||
* Processes all strings in the "connect to" slist, and uses the "connect
|
||||
* to host" and "connect to port" of the first string that matches.
|
||||
*/
|
||||
static CURLcode parse_connect_to_slist(struct SessionHandle *data,
|
||||
static CURLcode parse_connect_to_slist(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
struct curl_slist *conn_to_host)
|
||||
{
|
||||
@ -5546,7 +5546,7 @@ static CURLcode parse_connect_to_slist(struct SessionHandle *data,
|
||||
/*************************************************************
|
||||
* Resolve the address of the server or proxy
|
||||
*************************************************************/
|
||||
static CURLcode resolve_server(struct SessionHandle *data,
|
||||
static CURLcode resolve_server(struct Curl_easy *data,
|
||||
struct connectdata *conn,
|
||||
bool *async)
|
||||
{
|
||||
@ -5741,7 +5741,7 @@ static void reuse_conn(struct connectdata *old_conn,
|
||||
* *NOTE* this function assigns the conn->data pointer!
|
||||
*/
|
||||
|
||||
static CURLcode create_conn(struct SessionHandle *data,
|
||||
static CURLcode create_conn(struct Curl_easy *data,
|
||||
struct connectdata **in_connect,
|
||||
bool *async)
|
||||
{
|
||||
@ -6113,7 +6113,7 @@ static CURLcode create_conn(struct SessionHandle *data,
|
||||
strings in the session handle strings array!
|
||||
|
||||
Keep in mind that the pointers in the master copy are pointing to strings
|
||||
that will be freed as part of the SessionHandle struct, but all cloned
|
||||
that will be freed as part of the Curl_easy struct, but all cloned
|
||||
copies will be separately allocated.
|
||||
*/
|
||||
data->set.ssl.CApath = data->set.str[STRING_SSL_CAPATH];
|
||||
@ -6332,7 +6332,7 @@ CURLcode Curl_setup_conn(struct connectdata *conn,
|
||||
bool *protocol_done)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
Curl_pgrsTime(data, TIMER_NAMELOOKUP);
|
||||
|
||||
@ -6406,7 +6406,7 @@ CURLcode Curl_setup_conn(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode Curl_connect(struct SessionHandle *data,
|
||||
CURLcode Curl_connect(struct Curl_easy *data,
|
||||
struct connectdata **in_connect,
|
||||
bool *asyncp,
|
||||
bool *protocol_done)
|
||||
@ -6449,14 +6449,14 @@ CURLcode Curl_connect(struct SessionHandle *data,
|
||||
/*
|
||||
* Curl_init_do() inits the readwrite session. This is inited each time (in
|
||||
* the DO function before the protocol-specific DO functions are invoked) for
|
||||
* a transfer, sometimes multiple times on the same SessionHandle. Make sure
|
||||
* a transfer, sometimes multiple times on the same Curl_easy. Make sure
|
||||
* nothing in here depends on stuff that are setup dynamically for the
|
||||
* transfer.
|
||||
*
|
||||
* Allow this function to get called with 'conn' set to NULL.
|
||||
*/
|
||||
|
||||
CURLcode Curl_init_do(struct SessionHandle *data, struct connectdata *conn)
|
||||
CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn)
|
||||
{
|
||||
struct SingleRequest *k = &data->req;
|
||||
|
||||
|
28
lib/url.h
28
lib/url.h
@ -27,15 +27,15 @@
|
||||
* Prototypes for library-wide functions provided by url.c
|
||||
*/
|
||||
|
||||
CURLcode Curl_init_do(struct SessionHandle *data, struct connectdata *conn);
|
||||
CURLcode Curl_open(struct SessionHandle **curl);
|
||||
CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn);
|
||||
CURLcode Curl_open(struct Curl_easy **curl);
|
||||
CURLcode Curl_init_userdefined(struct UserDefined *set);
|
||||
CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
va_list arg);
|
||||
CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src);
|
||||
void Curl_freeset(struct SessionHandle * data);
|
||||
CURLcode Curl_close(struct SessionHandle *data); /* opposite of curl_open() */
|
||||
CURLcode Curl_connect(struct SessionHandle *, struct connectdata **,
|
||||
CURLcode Curl_dupset(struct Curl_easy * dst, struct Curl_easy * src);
|
||||
void Curl_freeset(struct Curl_easy * data);
|
||||
CURLcode Curl_close(struct Curl_easy *data); /* opposite of curl_open() */
|
||||
CURLcode Curl_connect(struct Curl_easy *, struct connectdata **,
|
||||
bool *async, bool *protocol_connect);
|
||||
CURLcode Curl_disconnect(struct connectdata *, bool dead_connection);
|
||||
CURLcode Curl_protocol_connect(struct connectdata *conn, bool *done);
|
||||
@ -43,7 +43,7 @@ CURLcode Curl_protocol_connecting(struct connectdata *conn, bool *done);
|
||||
CURLcode Curl_protocol_doing(struct connectdata *conn, bool *done);
|
||||
CURLcode Curl_setup_conn(struct connectdata *conn,
|
||||
bool *protocol_done);
|
||||
void Curl_free_request_state(struct SessionHandle *data);
|
||||
void Curl_free_request_state(struct Curl_easy *data);
|
||||
|
||||
int Curl_protocol_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
@ -52,19 +52,19 @@ int Curl_doing_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks);
|
||||
|
||||
bool Curl_isPipeliningEnabled(const struct SessionHandle *handle);
|
||||
CURLcode Curl_addHandleToPipeline(struct SessionHandle *handle,
|
||||
bool Curl_isPipeliningEnabled(const struct Curl_easy *handle);
|
||||
CURLcode Curl_addHandleToPipeline(struct Curl_easy *handle,
|
||||
struct curl_llist *pipeline);
|
||||
int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
|
||||
int Curl_removeHandleFromPipeline(struct Curl_easy *handle,
|
||||
struct curl_llist *pipeline);
|
||||
struct connectdata *
|
||||
Curl_oldest_idle_connection(struct SessionHandle *data);
|
||||
Curl_oldest_idle_connection(struct Curl_easy *data);
|
||||
/* remove the specified connection from all (possible) pipelines and related
|
||||
queues */
|
||||
void Curl_getoff_all_pipelines(struct SessionHandle *data,
|
||||
void Curl_getoff_all_pipelines(struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
|
||||
void Curl_close_connections(struct SessionHandle *data);
|
||||
void Curl_close_connections(struct Curl_easy *data);
|
||||
|
||||
#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
|
||||
|
||||
|
@ -208,14 +208,13 @@
|
||||
|
||||
#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
|
||||
#define GOOD_EASY_HANDLE(x) \
|
||||
((x) && (((struct SessionHandle *)(x))->magic == CURLEASY_MAGIC_NUMBER))
|
||||
((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER))
|
||||
|
||||
/* Some convenience macros to get the larger/smaller value out of two given.
|
||||
We prefix with CURL to prevent name collisions. */
|
||||
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
|
||||
#define CURLMIN(x,y) ((x)<(y)?(x):(y))
|
||||
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
/* Types needed for krb5-ftp connections */
|
||||
struct krb5buffer {
|
||||
@ -311,7 +310,7 @@ struct ssl_connect_data {
|
||||
#elif defined(USE_NSS)
|
||||
PRFileDesc *handle;
|
||||
char *client_nickname;
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
struct curl_llist *obj_list;
|
||||
PK11GenericObject *obj_clicert;
|
||||
#elif defined(USE_GSKIT)
|
||||
@ -618,9 +617,9 @@ enum upgrade101 {
|
||||
};
|
||||
|
||||
/*
|
||||
* Request specific data in the easy handle (SessionHandle). Previously,
|
||||
* Request specific data in the easy handle (Curl_easy). Previously,
|
||||
* these members were on the connectdata struct but since a conn struct may
|
||||
* now be shared between different SessionHandles, we store connection-specific
|
||||
* now be shared between different Curl_easys, we store connection-specific
|
||||
* data here. This struct only keeps stuff that's interesting for *this*
|
||||
* request, as it will be cleared between multiple ones
|
||||
*/
|
||||
@ -791,7 +790,7 @@ struct Curl_handler {
|
||||
|
||||
/* If used, this function gets called from transfer.c:readwrite_data() to
|
||||
allow the protocol to do extra reads/writes */
|
||||
CURLcode (*readwrite)(struct SessionHandle *data, struct connectdata *conn,
|
||||
CURLcode (*readwrite)(struct Curl_easy *data, struct connectdata *conn,
|
||||
ssize_t *nread, bool *readmore);
|
||||
|
||||
long defport; /* Default port. */
|
||||
@ -851,10 +850,10 @@ struct postponed_data {
|
||||
* unique for an entire connection.
|
||||
*/
|
||||
struct connectdata {
|
||||
/* 'data' is the CURRENT SessionHandle using this connection -- take great
|
||||
/* 'data' is the CURRENT Curl_easy using this connection -- take great
|
||||
caution that this might very well vary between different times this
|
||||
connection is used! */
|
||||
struct SessionHandle *data;
|
||||
struct Curl_easy *data;
|
||||
|
||||
/* chunk is for HTTP chunked encoding, but is in the general connectdata
|
||||
struct only because we can do just about any protocol through a HTTP proxy
|
||||
@ -965,7 +964,7 @@ struct connectdata {
|
||||
const struct Curl_handler *handler; /* Connection's protocol handler */
|
||||
const struct Curl_handler *given; /* The protocol first given */
|
||||
|
||||
long ip_version; /* copied from the SessionHandle at creation time */
|
||||
long ip_version; /* copied from the Curl_easy at creation time */
|
||||
|
||||
/**** curl_get() phase fields */
|
||||
|
||||
@ -1208,7 +1207,7 @@ typedef enum {
|
||||
/*
|
||||
* Values that are generated, temporary or calculated internally for a
|
||||
* "session handle" must be defined within the 'struct UrlState'. This struct
|
||||
* will be used within the SessionHandle struct. When the 'SessionHandle'
|
||||
* will be used within the Curl_easy struct. When the 'Curl_easy'
|
||||
* struct is cloned, this data MUST NOT be copied.
|
||||
*
|
||||
* Remember that any "state" information goes globally for the curl handle.
|
||||
@ -1354,7 +1353,7 @@ struct UrlState {
|
||||
curl_read_callback fread_func; /* read callback/function */
|
||||
void *in; /* CURLOPT_READDATA */
|
||||
|
||||
struct SessionHandle *stream_depends_on;
|
||||
struct Curl_easy *stream_depends_on;
|
||||
bool stream_depends_e; /* set or don't set the Exclusive bit */
|
||||
int stream_weight;
|
||||
};
|
||||
@ -1679,7 +1678,7 @@ struct UserDefined {
|
||||
new connection */
|
||||
long expect_100_timeout; /* in milliseconds */
|
||||
|
||||
struct SessionHandle *stream_depends_on;
|
||||
struct Curl_easy *stream_depends_on;
|
||||
bool stream_depends_e; /* set or don't set the Exclusive bit */
|
||||
int stream_weight;
|
||||
};
|
||||
@ -1704,10 +1703,10 @@ struct Names {
|
||||
* 'struct UrlState' instead.
|
||||
*/
|
||||
|
||||
struct SessionHandle {
|
||||
struct Curl_easy {
|
||||
/* first, two fields for the linked list of these */
|
||||
struct SessionHandle *next;
|
||||
struct SessionHandle *prev;
|
||||
struct Curl_easy *next;
|
||||
struct Curl_easy *prev;
|
||||
|
||||
struct connectdata *easy_conn; /* the "unit's" connection */
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
char **outptr, size_t *outlen)
|
||||
@ -110,7 +110,7 @@ CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
|
||||
const char *valuep, char **outptr,
|
||||
size_t *outlen)
|
||||
{
|
||||
@ -148,7 +148,7 @@ CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_external_message(struct Curl_easy *data,
|
||||
const char *user, char **outptr,
|
||||
size_t *outlen)
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_cram_md5_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
|
||||
const char *chlg,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
|
@ -324,7 +324,7 @@ static CURLcode auth_decode_digest_md5_message(const char *chlg64,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
||||
const char *chlg64,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
@ -645,7 +645,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const unsigned char *request,
|
||||
|
@ -62,7 +62,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
||||
const char *chlg64,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
@ -349,7 +349,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const unsigned char *request,
|
||||
|
@ -65,7 +65,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const char *service,
|
||||
@ -190,7 +190,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
||||
const char *chlg64,
|
||||
struct kerberos5data *krb5,
|
||||
char **outptr,
|
||||
|
@ -62,7 +62,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const char *service,
|
||||
@ -240,7 +240,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
||||
const char *chlg64,
|
||||
struct kerberos5data *krb5,
|
||||
char **outptr,
|
||||
|
@ -164,7 +164,7 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len)
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
static CURLcode ntlm_decode_type2_target(struct SessionHandle *data,
|
||||
static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
|
||||
unsigned char *buffer,
|
||||
size_t size,
|
||||
struct ntlmdata *ntlm)
|
||||
@ -232,7 +232,7 @@ static CURLcode ntlm_decode_type2_target(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
||||
const char *type2msg,
|
||||
struct ntlmdata *ntlm)
|
||||
{
|
||||
@ -465,7 +465,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
struct ntlmdata *ntlm,
|
||||
|
@ -162,7 +162,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
||||
const char *type2msg,
|
||||
struct ntlmdata *ntlm)
|
||||
{
|
||||
@ -214,7 +214,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
struct ntlmdata *ntlm,
|
||||
|
@ -55,7 +55,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
|
||||
const char *user,
|
||||
const char *host,
|
||||
const long port,
|
||||
|
@ -58,7 +58,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
||||
const char *user,
|
||||
const char *password,
|
||||
const char *service,
|
||||
@ -187,7 +187,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
|
||||
struct negotiatedata *nego,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
||||
const char *user,
|
||||
const char *password,
|
||||
const char *service,
|
||||
@ -234,7 +234,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
|
||||
struct negotiatedata *nego,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct SessionHandle;
|
||||
struct Curl_easy;
|
||||
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||
struct digestdata;
|
||||
@ -56,18 +56,18 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host,
|
||||
#endif
|
||||
|
||||
/* This is used to generate a base64 encoded PLAIN cleartext message */
|
||||
CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
char **outptr, size_t *outlen);
|
||||
|
||||
/* This is used to generate a base64 encoded LOGIN cleartext message */
|
||||
CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
|
||||
const char *valuep, char **outptr,
|
||||
size_t *outlen);
|
||||
|
||||
/* This is used to generate a base64 encoded EXTERNAL cleartext message */
|
||||
CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_external_message(struct Curl_easy *data,
|
||||
const char *user, char **outptr,
|
||||
size_t *outlen);
|
||||
|
||||
@ -77,14 +77,14 @@ CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
|
||||
size_t *outlen);
|
||||
|
||||
/* This is used to generate a CRAM-MD5 response message */
|
||||
CURLcode Curl_auth_create_cram_md5_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
|
||||
const char *chlg,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
char **outptr, size_t *outlen);
|
||||
|
||||
/* This is used to generate a base64 encoded DIGEST-MD5 response message */
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
||||
const char *chlg64,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
@ -96,7 +96,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
||||
struct digestdata *digest);
|
||||
|
||||
/* This is used to generate a HTTP DIGEST response message */
|
||||
CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const unsigned char *request,
|
||||
@ -117,12 +117,12 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
|
||||
size_t *outlen);
|
||||
|
||||
/* This is used to decode a base64 encoded NTLM type-2 message */
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
||||
const char *type2msg,
|
||||
struct ntlmdata *ntlm);
|
||||
|
||||
/* This is used to generate a base64 encoded NTLM type-3 message */
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
struct ntlmdata *ntlm,
|
||||
@ -133,7 +133,7 @@ void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm);
|
||||
#endif /* USE_NTLM */
|
||||
|
||||
/* This is used to generate a base64 encoded OAuth 2.0 message */
|
||||
CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
|
||||
const char *user,
|
||||
const char *host,
|
||||
const long port,
|
||||
@ -142,7 +142,7 @@ CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
|
||||
#if defined(USE_KERBEROS5)
|
||||
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) user token
|
||||
message */
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
|
||||
const char *userp,
|
||||
const char *passwdp,
|
||||
const char *service,
|
||||
@ -154,7 +154,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
|
||||
|
||||
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) security
|
||||
token message */
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
||||
const char *input,
|
||||
struct kerberos5data *krb5,
|
||||
char **outptr,
|
||||
@ -167,7 +167,7 @@ void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
|
||||
#if (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)) && defined(USE_SPNEGO)
|
||||
/* This is used to decode a base64 encoded SPNEGO (Negotiate) challenge
|
||||
message */
|
||||
CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
||||
const char *user,
|
||||
const char *passwood,
|
||||
const char *service,
|
||||
@ -177,7 +177,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
|
||||
|
||||
/* This is used to generate a base64 encoded SPNEGO (Negotiate) response
|
||||
message */
|
||||
CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
|
||||
CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
|
||||
struct negotiatedata *nego,
|
||||
char **outptr, size_t *outlen);
|
||||
|
||||
|
@ -137,7 +137,7 @@ static void free_ssl_structs(struct ssl_connect_data *connssl)
|
||||
*/
|
||||
static CURLcode connect_prep(struct connectdata *conn, int sockindex)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
SSL_CTX *ssl_ctx;
|
||||
SSL *ssl = NULL;
|
||||
int cert_types[] = {SSL_OBJ_X509_CERT, SSL_OBJ_PKCS12, 0};
|
||||
@ -284,7 +284,7 @@ static CURLcode connect_prep(struct connectdata *conn, int sockindex)
|
||||
*/
|
||||
static CURLcode connect_finish(struct connectdata *conn, int sockindex)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
SSL *ssl = conn->ssl[sockindex].ssl;
|
||||
const char *peer_CN;
|
||||
uint32_t dns_altname_index;
|
||||
@ -472,7 +472,7 @@ Curl_axtls_connect(struct connectdata *conn,
|
||||
int sockindex)
|
||||
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
CURLcode conn_step = connect_prep(conn, sockindex);
|
||||
int ssl_fcn_return;
|
||||
SSL *ssl = conn->ssl[sockindex].ssl;
|
||||
@ -562,7 +562,7 @@ int Curl_axtls_shutdown(struct connectdata *conn, int sockindex)
|
||||
*/
|
||||
int retval = 0;
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct Curl_easy *data = conn->data;
|
||||
uint8_t *buf;
|
||||
ssize_t nread;
|
||||
|
||||
@ -678,7 +678,7 @@ size_t Curl_axtls_version(char *buffer, size_t size)
|
||||
return snprintf(buffer, size, "axTLS/%s", ssl_version());
|
||||
}
|
||||
|
||||
int Curl_axtls_random(struct SessionHandle *data,
|
||||
int Curl_axtls_random(struct Curl_easy *data,
|
||||
unsigned char *entropy,
|
||||
size_t length)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user