Newer
Older
is always set TRUE when curl_easy_perform() is called. */
struct digestdata digest;
struct digestdata proxydigest;
#ifdef HAVE_GSSAPI
struct negotiatedata negotiate;
#endif
struct auth authhost;
struct auth authproxy;
Daniel Stenberg
committed
Daniel Stenberg
committed
bool authproblem; /* TRUE if there's some problem authenticating */
Daniel Stenberg
committed
#ifdef USE_ARES
ares_channel areschannel; /* for name resolves */
#endif
Daniel Stenberg
committed
#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
ENGINE *engine;
#endif /* USE_SSLEAY */
Daniel Stenberg
committed
struct timeval expiretime; /* set this with Curl_expire() only */
struct Curl_tree timenode; /* for the splay stuff */
/* a place to store the most recenlty set FTP entrypath */
char *most_recent_ftp_entrypath;
Daniel Stenberg
committed
/* set after initial USER failure, to prevent an authentication loop */
bool ftp_trying_alternative;
Daniel Stenberg
committed
bool expect100header; /* TRUE if we added Expect: 100-continue */
bool pipe_broke; /* TRUE if the connection we were pipelined on broke
and we need to restart from the beginning */
bool cancelled; /* TRUE if the request was cancelled */
#ifndef WIN32
/* do FTP line-end conversions on most platforms */
#define CURL_DO_LINEEND_CONV
/* for FTP downloads: track CRLF sequences that span blocks */
bool prev_block_had_trailing_cr;
/* for FTP downloads: how many CRLFs did we converted to LFs? */
Daniel Stenberg
committed
curl_off_t crlf_conversions;
#endif
/* If set to non-NULL, there's a connection in a shared connection cache
that uses this handle so we can't kill this SessionHandle just yet but
must keep it around and add it to the list of handles to kill once all
its connections are gone */
void *shared_conn;
Daniel Stenberg
committed
bool closed; /* set to TRUE when curl_easy_cleanup() has been called on this
handle, but it is kept around as mentioned for
shared_conn */
Daniel Stenberg
committed
Daniel Stenberg
committed
* This 'DynamicStatic' struct defines dynamic states that actually change
* values in the 'UserDefined' area, which MUST be taken into consideration
* if the UserDefined struct is cloned or similar. You can probably just
* copy these, but each one indicate a special action on other data.
*/
struct DynamicStatic {
char *url; /* work URL, copied from UserDefined */
bool url_alloc; /* URL string is malloc()'ed */
bool url_changed; /* set on CURL_OPT_URL, used to detect if the URL was
changed after the connect phase, as we allow callback
to change it and if so, we reconnect to use the new
URL instead */
Daniel Stenberg
committed
char *proxy; /* work proxy, copied from UserDefined */
bool proxy_alloc; /* http proxy string is malloc()'ed */
char *referer; /* referer string */
bool referer_alloc; /* referer sting is malloc()ed */
Daniel Stenberg
committed
struct curl_slist *cookielist; /* list of cookie files set by
curl_easy_setopt(COOKIEFILE) calls */
Daniel Stenberg
committed
};
/*
* This 'UserDefined' struct must only contain data that is set once to go
* for many (perhaps) independent connections. Values that are generated or
Daniel Stenberg
committed
* calculated internally for the "session handle" MUST be defined within the
* 'struct UrlState' instead. The only exceptions MUST note the changes in
Daniel Stenberg
committed
* the 'DynamicStatic' struct.
Daniel Stenberg
committed
struct Curl_one_easy; /* declared and used only in multi.c */
struct Curl_multi; /* declared and used only in multi.c */
Daniel Stenberg
committed
struct UserDefined {
FILE *err; /* the stderr user data goes here */
void *debugdata; /* the data that will be passed to fdebug */
char *errorbuffer; /* store failure messages in here */
char *proxyuserpwd; /* Proxy <user:password>, if used */
long proxyport; /* If non-zero, use this port number by default. If the
proxy string features a ":[port]" that one will override
void *out; /* the fetched file goes here */
void *in; /* the uploaded file is read from here */
void *writeheader; /* write the header to this if non-NULL */
Daniel Stenberg
committed
char *set_url; /* what original URL to work on */
char *set_proxy; /* proxy to use */
long use_port; /* which port to use (when not using default) */
char *userpwd; /* <user:password>, if used */
long httpauth; /* what kind of HTTP authentication to use (bitmask) */
long proxyauth; /* what kind of proxy authentication to use (bitmask) */
Daniel Stenberg
committed
char *set_range; /* range, if used. See README for detailed specification
on this syntax. */
long followlocation; /* as in HTTP Location: */
long maxredirs; /* maximum no. of http(s) redirects to follow, set to -1
for infinity */
Daniel Stenberg
committed
char *set_referer; /* custom string */
bool free_referer; /* set TRUE if 'referer' points to a string we
allocated */
char *encoding; /* Accept-Encoding string */
Daniel Stenberg
committed
char *postfields; /* if POST, set the fields' values here */
curl_off_t postfieldsize; /* if POST, this might have a size to use instead
of strlen(), and then the data *may* be binary
(contain zero bytes) */
Daniel Stenberg
committed
char *ftpport; /* port to send with the FTP PORT command */
Daniel Stenberg
committed
char *device; /* local network interface/address to use */
unsigned short localport; /* local port number to bind to */
int localportrange; /* number of additional port numbers to test in case the
'localport' one can't be bind()ed */
Daniel Stenberg
committed
curl_write_callback fwrite; /* function that stores the output */
curl_write_callback fwrite_header; /* function that stores headers */
curl_read_callback fread; /* function that reads the input */
curl_progress_callback fprogress; /* function for progress information */
curl_debug_callback fdebug; /* function that write informational data */
curl_ioctl_callback ioctl; /* function for I/O control */
curl_sockopt_callback fsockopt; /* function for setting socket options */
void *sockopt_client; /* pointer to pass to the socket options callback */
/* the 3 curl_conv_callback functions below are used on non-ASCII hosts */
/* function to convert from the network encoding: */
curl_conv_callback convfromnetwork;
/* function to convert to the network encoding: */
curl_conv_callback convtonetwork;
/* function to convert from UTF-8 encoding: */
curl_conv_callback convfromutf8;
void *progress_client; /* pointer to pass to the progress callback */
void *ioctl_client; /* pointer to pass to the ioctl callback */
Daniel Stenberg
committed
long timeout; /* in seconds, 0 means no timeout */
long connecttimeout; /* in seconds, 0 means no timeout */
long ftp_response_timeout; /* in seconds, 0 means no timeout */
curl_off_t infilesize; /* size of file to upload, -1 means unknown */
long low_speed_limit; /* bytes/second */
long low_speed_time; /* number of seconds */
curl_off_t max_send_speed; /* high speed limit in bytes/second for upload */
curl_off_t max_recv_speed; /* high speed limit in bytes/second for download */
curl_off_t set_resume_from; /* continue [ftp] transfer from here */
Daniel Stenberg
committed
char *cookie; /* HTTP cookie string to send */
struct curl_slist *headers; /* linked list of extra headers */
struct curl_httppost *httppost; /* linked list of POST data */
char *cert; /* certificate */
char *cert_type; /* format for certificate (default: PEM) */
char *key; /* private key */
char *key_type; /* format for private key (default: PEM) */
char *key_passwd; /* plain text private key password */
Daniel Stenberg
committed
char *cookiejar; /* dump all cookies to this file */
bool cookiesession; /* new cookie session? */
Daniel Stenberg
committed
bool crlf; /* convert crlf on ftp upload(?) */
Daniel Stenberg
committed
char *ftp_account; /* ftp account data */
Daniel Stenberg
committed
char *ftp_alternative_to_user; /* command to send if USER/PASS fails */
struct curl_slist *quote; /* after connection is established */
struct curl_slist *postquote; /* after the transfer */
struct curl_slist *prequote; /* before the transfer, after type */
struct curl_slist *source_quote; /* 3rd party quote */
struct curl_slist *source_prequote; /* in 3rd party transfer mode - before
the transfer on source host */
struct curl_slist *source_postquote; /* in 3rd party transfer mode - after
the transfer on source host */
struct curl_slist *telnet_options; /* linked list of telnet options */
curl_TimeCond timecondition; /* kind of time/date comparison */
time_t timevalue; /* what time to compare with */
Daniel Stenberg
committed
curl_closepolicy closepolicy; /* connection cache close concept */
Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */
char *customrequest; /* HTTP/FTP request to use */
long httpversion; /* when non-zero, a specific HTTP version requested to
be used in the library's request(s) */
Daniel Stenberg
committed
char *auth_host; /* if set, this is the allocated string to the host name
* to which to send the authorization data to, and no other
* host (which location-following otherwise could lead to)
*/
char *krb4_level; /* what security level */
Daniel Stenberg
committed
struct ssl_config_data ssl; /* user defined SSL stuff */
Daniel Stenberg
committed
curl_proxytype proxytype; /* what kind of proxy that is in use */
int dns_cache_timeout; /* DNS cache timeout */
long buffer_size; /* size of receive buffer to use */
Daniel Stenberg
committed
char *private_data; /* Private data */
Daniel Stenberg
committed
struct Curl_one_easy *one_easy; /* When adding an easy handle to a multi
handle, an internal 'Curl_one_easy'
struct is created and this is a pointer
to the particular struct associated with
this SessionHandle */
struct curl_slist *http200aliases; /* linked list of aliases for http200 */
long ip_version;
curl_off_t max_filesize; /* Maximum file size to download */
char *source_url; /* for 3rd party transfer */
char *source_userpwd; /* for 3rd party transfer */
curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used */
Daniel Stenberg
committed
/* Here follows boolean settings that define how to behave during
this session. They are STATIC, set by libcurl users or at least initially
and they don't change during operations. */
bool printhost; /* printing host name in debug info */
Daniel Stenberg
committed
bool get_filetime;
bool tunnel_thru_httpproxy;
Daniel Stenberg
committed
bool prefer_ascii; /* ASCII rather than binary */
Daniel Stenberg
committed
bool ftp_append;
bool ftp_list_only;
bool ftp_create_missing_dirs;
Daniel Stenberg
committed
bool ftp_use_port;
bool hide_progress;
bool http_fail_on_error;
bool http_follow_location;
bool http_disable_hostname_check_before_authentication;
bool include_header; /* include received protocol headers in data output */
Daniel Stenberg
committed
bool http_set_referer;
bool http_auto_referer; /* set "correct" referer when following location: */
Daniel Stenberg
committed
bool opt_no_body; /* as set with CURLOPT_NO_BODY */
Daniel Stenberg
committed
bool set_port;
bool upload;
enum CURL_NETRC_OPTION
use_netrc; /* defined in include/curl.h */
char *netrc_file; /* if not NULL, use this instead of trying to find
$HOME/.netrc */
Daniel Stenberg
committed
bool verbose;
bool krb4; /* kerberos4 connection requested */
bool reuse_forbid; /* forbidden to be reused, close after use */
bool reuse_fresh; /* do not re-use an existing connection */
bool ftp_use_epsv; /* if EPSV is to be attempted or not */
bool ftp_use_eprt; /* if EPRT is to be attempted or not */
Daniel Stenberg
committed
curl_ftpssl ftp_ssl; /* if AUTH TLS is to be attempted etc */
curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */
bool no_signal; /* do not use any signal/alarm handler */
Daniel Stenberg
committed
bool global_dns_cache; /* subject for future removal */
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */
Daniel Stenberg
committed
bool ignorecl; /* ignore content length */
bool ftp_skip_ip; /* skip the IP address the FTP server passes on to
us */
Daniel Stenberg
committed
bool connect_only; /* make connection, let application use the socket */
Daniel Stenberg
committed
};
Daniel Stenberg
committed
struct Names {
struct curl_hash *hostcache;
enum {
HCACHE_NONE, /* not pointing to anything */
HCACHE_PRIVATE, /* points to our own */
HCACHE_GLOBAL, /* points to the (shrug) global one */
HCACHE_MULTI, /* points to a shared one in the multi handle */
HCACHE_SHARED /* points to a shared one in a shared object */
} hostcachetype;
};
Daniel Stenberg
committed
/*
Daniel Stenberg
committed
* The 'connectdata' struct MUST have all the connection oriented stuff as we
* may have several simultaneous connections and connection structs in memory.
Daniel Stenberg
committed
*
Daniel Stenberg
committed
* The 'struct UserDefined' must only contain data that is set once to go for
* many (perhaps) independent connections. Values that are generated or
Daniel Stenberg
committed
* calculated internally for the "session handle" must be defined within the
Daniel Stenberg
committed
* 'struct UrlState' instead.
*/
Daniel Stenberg
committed
struct SessionHandle {
Daniel Stenberg
committed
struct Names dns;
Daniel Stenberg
committed
struct Curl_multi *multi; /* if non-NULL, points to the multi handle
struct to which this "belongs" */
struct Curl_share *share; /* Share, handles global variable mutexing */
struct HandleData reqdata; /* Request-specific data */
Daniel Stenberg
committed
struct UserDefined set; /* values set by the libcurl user */
struct DynamicStatic change; /* possibly modified userdefined data */
struct CookieInfo *cookies; /* the cookies, read from files and servers */
struct Progress progress; /* for all the progress meter data */
struct UrlState state; /* struct for fields used for state info and
other dynamic purposes */
struct PureInfo info; /* stats, reports and info data */
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
iconv_t outbound_cd; /* for translating to the network encoding */
iconv_t inbound_cd; /* for translating from the network encoding */
iconv_t utf8_cd; /* for translating to UTF8 */
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
unsigned int magic; /* set to a CURLEASY_MAGIC_NUMBER */
};
#define LIBCURL_NAME "libcurl"
#endif