00001
00002
00003
00004
00005 #ifndef __URLDATA_H
00006 #define __URLDATA_H
00007
00008 #include "setup.h"
00009
00010 #define PORT_FTP 21
00011 #define PORT_FTPS 990
00012 #define PORT_TELNET 23
00013 #define PORT_HTTP 80
00014 #define PORT_HTTPS 443
00015 #define PORT_DICT 2628
00016 #define PORT_LDAP 389
00017 #define PORT_TFTP 69
00018 #define PORT_SSH 22
00019
00020 #define DICT_MATCH "/MATCH:"
00021 #define DICT_MATCH2 "/M:"
00022 #define DICT_MATCH3 "/FIND:"
00023 #define DICT_DEFINE "/DEFINE:"
00024 #define DICT_DEFINE2 "/D:"
00025 #define DICT_DEFINE3 "/LOOKUP:"
00026
00027 #define CURL_DEFAULT_USER "anonymous"
00028 #define CURL_DEFAULT_PASSWORD "ftp@example.com"
00029
00030 #include "cookie.h"
00031 #include "formdata.h"
00032
00033 #ifdef USE_SSLEAY
00034 #ifdef USE_OPENSSL
00035 #include "openssl/rsa.h"
00036 #include "openssl/crypto.h"
00037 #include "openssl/x509.h"
00038 #include "openssl/pem.h"
00039 #include "openssl/ssl.h"
00040 #include "openssl/err.h"
00041 #ifdef HAVE_OPENSSL_ENGINE_H
00042 #include <openssl/engine.h>
00043 #endif
00044 #ifdef HAVE_OPENSSL_PKCS12_H
00045 #include <openssl/pkcs12.h>
00046 #endif
00047 #else
00048 #include "rsa.h"
00049 #include "crypto.h"
00050 #include "x509.h"
00051 #include "pem.h"
00052 #include "ssl.h"
00053 #include "err.h"
00054 #endif
00055 #endif
00056
00057 #ifdef USE_GNUTLS
00058 #include <gnutls/gnutls.h>
00059 #endif
00060
00061 #ifdef USE_NSS
00062 #include <nspr.h>
00063 #endif
00064
00065 #ifdef HAVE_NETINET_IN_H
00066 #include <netinet/in.h>
00067 #endif
00068
00069 #include "timeval.h"
00070
00071 #ifdef HAVE_ZLIB_H
00072 #include <zlib.h>
00073 #endif
00074
00075 #ifdef USE_ARES
00076 #include <ares.h>
00077 #endif
00078
00079 #include <curl/curl.h>
00080
00081 #include "http_chunks.h"
00082 #include "hostip.h"
00083 #include "hash.h"
00084 #include "splay.h"
00085
00086 #ifdef HAVE_GSSAPI
00087 # ifdef HAVE_GSSGNU
00088 # include <gss.h>
00089 # elif defined HAVE_GSSMIT
00090 # include <gssapi/gssapi.h>
00091 # include <gssapi/gssapi_generic.h>
00092 # else
00093 # include <gssapi.h>
00094 # endif
00095 #endif
00096
00097 #ifdef HAVE_LIBSSH2_H
00098 #include <libssh2.h>
00099 #include <libssh2_sftp.h>
00100 #endif
00101
00102 #undef BUFSIZE
00103 #define BUFSIZE CURL_MAX_WRITE_SIZE
00104
00105 #define HEADERSIZE 256
00106
00107 #define CURLEASY_MAGIC_NUMBER 0xc0dedbad
00108
00109 #define CURLMAX(x,y) ((x)>(y)?(x):(y))
00110
00111 #if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
00112
00113 struct krb4buffer {
00114 void *data;
00115 size_t size;
00116 size_t index;
00117 int eof_flag;
00118 };
00119 enum protection_level {
00120 prot_clear,
00121 prot_safe,
00122 prot_confidential,
00123 prot_private,
00124 prot_cmd
00125 };
00126 #endif
00127
00128 typedef enum {
00129 ssl_connect_1,
00130 ssl_connect_2,
00131 ssl_connect_2_reading,
00132 ssl_connect_2_writing,
00133 ssl_connect_3,
00134 ssl_connect_done
00135 } ssl_connect_state;
00136
00137 struct ssl_connect_data {
00138 bool use;
00139 #ifdef USE_SSLEAY
00140
00141 SSL_CTX* ctx;
00142 SSL* handle;
00143 X509* server_cert;
00144 ssl_connect_state connecting_state;
00145 #endif
00146 #ifdef USE_GNUTLS
00147 gnutls_session session;
00148 gnutls_certificate_credentials cred;
00149 #endif
00150 #ifdef USE_NSS
00151 PRFileDesc *handle;
00152 #endif
00153 };
00154
00155 struct ssl_config_data {
00156 long version;
00157 long certverifyresult;
00158 long verifypeer;
00159 long verifyhost;
00160 char *CApath;
00161 char *CAfile;
00162 char *random_file;
00163 char *egdsocket;
00164 char *cipher_list;
00165 long numsessions;
00166 curl_ssl_ctx_callback fsslctx;
00167 void *fsslctxp;
00168 bool sessionid;
00169 };
00170
00171 struct curl_ssl_session {
00172 char *name;
00173 void *sessionid;
00174 size_t idsize;
00175 long age;
00176 unsigned short remote_port;
00177 struct ssl_config_data ssl_config;
00178 };
00179
00180 struct digestdata {
00181 char *nonce;
00182 char *cnonce;
00183 char *realm;
00184 int algo;
00185 bool stale;
00186 char *opaque;
00187 char *qop;
00188 char *algorithm;
00189 int nc;
00190 };
00191
00192 typedef enum {
00193 NTLMSTATE_NONE,
00194 NTLMSTATE_TYPE1,
00195 NTLMSTATE_TYPE2,
00196 NTLMSTATE_TYPE3,
00197 NTLMSTATE_LAST
00198 } curlntlm;
00199
00200 #ifdef USE_WINDOWS_SSPI
00201
00202 #define SECURITY_WIN32 1
00203 #include <security.h>
00204 #include <sspi.h>
00205 #include <rpc.h>
00206 #endif
00207
00208 #if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
00209 #include <iconv.h>
00210 #endif
00211
00212 struct ntlmdata {
00213 curlntlm state;
00214 #ifdef USE_WINDOWS_SSPI
00215 CredHandle handle;
00216 CtxtHandle c_handle;
00217 SEC_WINNT_AUTH_IDENTITY identity;
00218 SEC_WINNT_AUTH_IDENTITY *p_identity;
00219 int has_handles;
00220 void *type_2;
00221 int n_type_2;
00222 #else
00223 unsigned int flags;
00224 unsigned char nonce[8];
00225 #endif
00226 };
00227
00228 #ifdef HAVE_GSSAPI
00229 struct negotiatedata {
00230 bool gss;
00231 const char* protocol;
00232 OM_uint32 status;
00233 gss_ctx_id_t context;
00234 gss_name_t server_name;
00235 gss_buffer_desc output_token;
00236 };
00237 #endif
00238
00239 struct HTTP {
00240 struct FormData *sendit;
00241 curl_off_t postsize;
00242 char *postdata;
00243
00244 const char *p_pragma;
00245 const char *p_accept;
00246 curl_off_t readbytecount;
00247 curl_off_t writebytecount;
00248
00249
00250 struct Form form;
00251 struct Curl_chunker chunk;
00252
00253 struct back {
00254 curl_read_callback fread;
00255 void *fread_in;
00256 char *postdata;
00257 curl_off_t postsize;
00258 } backup;
00259
00260 enum {
00261 HTTPSEND_NADA,
00262 HTTPSEND_REQUEST,
00263 HTTPSEND_BODY,
00264 HTTPSEND_LAST
00265 } sending;
00266
00267 void *send_buffer;
00268 };
00269
00270 typedef enum {
00271 FTP_STOP,
00272 FTP_WAIT220,
00273 FTP_AUTH,
00274 FTP_USER,
00275 FTP_PASS,
00276 FTP_ACCT,
00277 FTP_PBSZ,
00278 FTP_PROT,
00279 FTP_CCC,
00280 FTP_PWD,
00281 FTP_QUOTE,
00282 FTP_RETR_PREQUOTE,
00283 FTP_STOR_PREQUOTE,
00284 FTP_POSTQUOTE,
00285 FTP_CWD,
00286 FTP_MKD,
00287 FTP_MDTM,
00288 FTP_TYPE,
00289 FTP_LIST_TYPE,
00290 FTP_RETR_TYPE,
00291 FTP_STOR_TYPE,
00292 FTP_SIZE,
00293 FTP_RETR_SIZE,
00294 FTP_STOR_SIZE,
00295 FTP_REST,
00296 FTP_RETR_REST,
00297 FTP_PORT,
00298 FTP_PASV,
00299 FTP_LIST,
00300 FTP_RETR,
00301 FTP_STOR,
00302 FTP_QUIT,
00303 FTP_LAST
00304 } ftpstate;
00305
00306 typedef enum {
00307 FTPFILE_MULTICWD = 1,
00308 FTPFILE_NOCWD = 2,
00309 FTPFILE_SINGLECWD = 3
00310 } curl_ftpfile;
00311
00312 struct FTP {
00313 curl_off_t *bytecountp;
00314 char *user;
00315 char *passwd;
00316 char *urlpath;
00317 char *file;
00318 bool no_transfer;
00319 curl_off_t downloadsize;
00320 };
00321
00322 struct ftp_conn {
00323 char *entrypath;
00324 char **dirs;
00325 int dirdepth;
00326 int diralloc;
00327 char *cache;
00328 curl_off_t cache_size;
00329 bool dont_check;
00330 long response_time;
00331 bool ctl_valid;
00332 bool cwddone;
00333 bool cwdfail;
00334 char *prevpath;
00335 char transfertype;
00336 size_t nread_resp;
00337 char *linestart_resp;
00338
00339 int count1;
00340 int count2;
00341 int count3;
00342 char *sendthis;
00343 size_t sendleft;
00344 size_t sendsize;
00345 struct timeval response;
00346 ftpstate state;
00347 };
00348
00349 typedef enum {
00350 SSH_STOP,
00351 SSH_S_STARTUP,
00352 SSH_AUTHLIST,
00353 SSH_AUTH_PKEY_INIT,
00354 SSH_AUTH_PKEY,
00355 SSH_AUTH_PASS_INIT,
00356 SSH_AUTH_PASS,
00357 SSH_AUTH_HOST_INIT,
00358 SSH_AUTH_HOST,
00359 SSH_AUTH_KEY_INIT,
00360 SSH_AUTH_KEY,
00361 SSH_AUTH_DONE,
00362 SSH_SFTP_INIT,
00363 SSH_SFTP_REALPATH,
00364 SSH_GET_WORKINGPATH,
00365 SSH_SFTP_SHUTDOWN,
00366 SSH_SESSION_FREE,
00367 SSH_QUIT,
00368 SSH_LAST
00369 } sshstate;
00370
00371 struct SSHPROTO {
00372 curl_off_t *bytecountp;
00373 char *user;
00374 char *passwd;
00375 char *path;
00376 char *homedir;
00377 char *errorstr;
00378 #ifdef USE_LIBSSH2
00379 LIBSSH2_SESSION *ssh_session;
00380 LIBSSH2_CHANNEL *ssh_channel;
00381 LIBSSH2_SFTP *sftp_session;
00382 LIBSSH2_SFTP_HANDLE *sftp_handle;
00383 #endif
00384 };
00385
00386 struct ssh_conn {
00387 const char *authlist;
00388 const char *passphrase;
00389 char *rsa_pub;
00390 char *rsa;
00391 bool authed;
00392 sshstate state;
00393 CURLcode actualCode;
00394 };
00395
00396 struct FILEPROTO {
00397 char *path;
00398 char *freepath;
00399 int fd;
00400 };
00401
00402 struct ConnectBits {
00403 bool close;
00404 bool reuse;
00405 bool chunk;
00406 bool proxy;
00407 bool httpproxy;
00408 bool user_passwd;
00409 bool proxy_user_passwd;
00410 bool ipv6_ip;
00411 bool ipv6;
00412
00413 bool do_more;
00414
00415 bool upload_chunky;
00416 bool getheader;
00417
00418 bool forbidchunk;
00419
00420 bool tcpconnect;
00421 bool protoconnstart;
00422
00423 bool retry;
00424 bool no_body;
00425 bool tunnel_proxy;
00426 bool tunnel_connecting;
00427 bool authneg;
00428 bool rewindaftersend;
00429 bool ftp_use_epsv;
00430
00431 bool ftp_use_eprt;
00432 bool netrc;
00433
00434 bool trailerHdrPresent;
00435 bool done;
00436 bool stream_was_rewound;
00437 bool proxy_connect_closed;
00438 };
00439
00440 struct hostname {
00441 char *rawalloc;
00442 char *encalloc;
00443 char *name;
00444 char *dispname;
00445 };
00446
00447 #define KEEP_NONE 0
00448 #define KEEP_READ 1
00449 #define KEEP_WRITE 2
00450 #define KEEP_READ_HOLD 4
00451 #define KEEP_WRITE_HOLD 8
00452
00453 #ifdef HAVE_LIBZ
00454 typedef enum {
00455 ZLIB_UNINIT,
00456 ZLIB_INIT,
00457 ZLIB_GZIP_HEADER,
00458 ZLIB_GZIP_INFLATING,
00459 ZLIB_INIT_GZIP
00460 } zlibInitState;
00461 #endif
00462
00463 struct Curl_transfer_keeper {
00464
00465
00466
00467 curl_off_t size;
00468 curl_off_t *bytecountp;
00469
00470 curl_off_t maxdownload;
00471 curl_off_t *writebytecountp;
00472
00473
00474
00475 curl_off_t bytecount;
00476 curl_off_t writebytecount;
00477
00478 long headerbytecount;
00479 long deductheadercount;
00480
00481 struct timeval start;
00482 struct timeval now;
00483 bool header;
00484 enum {
00485 HEADER_NORMAL,
00486 HEADER_PARTHEADER,
00487 HEADER_ALLBAD
00488 } badheader;
00489 int headerline;
00490 char *hbufp;
00491 size_t hbuflen;
00492 char *str;
00493 char *str_start;
00494 char *end_ptr;
00495 char *p;
00496 bool content_range;
00497 curl_off_t offset;
00498 int httpcode;
00499 int httpversion;
00500 struct timeval start100;
00501 bool write_after_100_header;
00502 bool wait100_after_headers;
00503 int content_encoding;
00504
00505 #define IDENTITY 0
00506 #define DEFLATE 1
00507 #define GZIP 2
00508 #define COMPRESS 3
00509
00510 #ifdef HAVE_LIBZ
00511 zlibInitState zlib_init;
00512 z_stream z;
00513 #endif
00514
00515 time_t timeofdoc;
00516 long bodywrites;
00517
00518 char *buf;
00519 char *uploadbuf;
00520 curl_socket_t maxfd;
00521
00522 int keepon;
00523
00524 bool upload_done;
00525
00526 bool ignorebody;
00527 bool ignorecl;
00528 };
00529
00530 #if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
00531 defined(USE_THREADING_GETADDRINFO)
00532 struct Curl_async {
00533 char *hostname;
00534 int port;
00535 struct Curl_dns_entry *dns;
00536 bool done;
00537 int status;
00538 void *os_specific;
00539 };
00540 #endif
00541
00542 #define FIRSTSOCKET 0
00543 #define SECONDARYSOCKET 1
00544
00545 typedef CURLcode (*Curl_do_more_func)(struct connectdata *);
00546 typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode, bool);
00547
00548 struct HandleData {
00549 char *pathbuffer;
00550 char *path;
00551
00552 char *newurl;
00553
00554
00555 struct Curl_transfer_keeper keep;
00556
00557
00558 ssize_t upload_present;
00559
00560
00561 char *upload_fromhere;
00562
00563 curl_off_t size;
00564 curl_off_t *bytecountp;
00565
00566 curl_off_t maxdownload;
00567 curl_off_t *writebytecountp;
00568
00569 bool use_range;
00570 bool rangestringalloc;
00571
00572 char *range;
00573 curl_off_t resume_from;
00574
00575
00576
00577 union {
00578 struct HTTP *http;
00579 struct HTTP *https;
00580 struct FTP *ftp;
00581 void *tftp;
00582 struct FILEPROTO *file;
00583 void *telnet;
00584 void *generic;
00585 struct SSHPROTO *ssh;
00586 } proto;
00587 };
00588
00589 struct connectdata {
00590
00591 struct SessionHandle *data;
00592
00593 bool inuse;
00594
00595
00596 long connectindex;
00597 long protocol;
00598 #define PROT_MISSING (1<<0)
00599 #define PROT_HTTP (1<<2)
00600 #define PROT_HTTPS (1<<3)
00601 #define PROT_FTP (1<<4)
00602 #define PROT_TELNET (1<<5)
00603 #define PROT_DICT (1<<6)
00604 #define PROT_LDAP (1<<7)
00605 #define PROT_FILE (1<<8)
00606 #define PROT_FTPS (1<<9)
00607 #define PROT_SSL (1<<10)
00608 #define PROT_TFTP (1<<11)
00609 #define PROT_SCP (1<<12)
00610 #define PROT_SFTP (1<<13)
00611
00612 #define PROT_CLOSEACTION PROT_FTP
00613
00614
00615 struct Curl_dns_entry *dns_entry;
00616
00617
00618 Curl_addrinfo *ip_addr;
00619
00620
00621 char *ip_addr_str;
00622
00623 char protostr[16];
00624 int socktype;
00625
00626 struct hostname host;
00627 struct hostname proxy;
00628
00629 long port;
00630 unsigned short remote_port;
00631
00632 char *user;
00633 char *passwd;
00634
00635 char *proxyuser;
00636 char *proxypasswd;
00637 curl_proxytype proxytype;
00638
00639 struct timeval now;
00640 struct timeval created;
00641 curl_socket_t sock[2];
00642
00643 struct ssl_connect_data ssl[2];
00644 struct ssl_config_data ssl_config;
00645
00646 struct ConnectBits bits;
00647
00648
00649 CURLcode (*curl_do)(struct connectdata *, bool *done);
00650 Curl_done_func curl_done;
00651
00652
00653 Curl_do_more_func curl_do_more;
00654
00655
00656 CURLcode (*curl_connect)(struct connectdata *, bool *done);
00657
00658
00659 CURLcode (*curl_connecting)(struct connectdata *, bool *done);
00660 CURLcode (*curl_doing)(struct connectdata *, bool *done);
00661
00662
00663 int (*curl_proto_getsock)(struct connectdata *conn,
00664 curl_socket_t *socks,
00665 int numsocks);
00666
00667
00668 int (*curl_doing_getsock)(struct connectdata *conn,
00669 curl_socket_t *socks,
00670 int numsocks);
00671
00672
00673 CURLcode (*curl_disconnect)(struct connectdata *);
00674
00675
00676 CURLcode (*curl_close)(struct connectdata *);
00677
00678
00679
00680 curl_socket_t sockfd;
00681 curl_socket_t writesockfd;
00682
00683
00684
00685 struct dynamically_allocated_data {
00686 char *proxyuserpwd;
00687 char *uagent;
00688 char *accept_encoding;
00689 char *userpwd;
00690 char *rangeline;
00691 char *ref;
00692 char *host;
00693 char *cookiehost;
00694 } allocptr;
00695
00696 int sec_complete;
00697 #if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
00698 enum protection_level command_prot;
00699 enum protection_level data_prot;
00700 enum protection_level request_data_prot;
00701 size_t buffer_size;
00702 struct krb4buffer in_buffer, out_buffer;
00703 void *app_data;
00704 const struct Curl_sec_client_mech *mech;
00705 struct sockaddr_in local_addr;
00706 #endif
00707
00708 bool readchannel_inuse;
00709 bool writechannel_inuse;
00710 bool is_in_pipeline;
00711
00712 struct curl_llist *send_pipe;
00713 struct curl_llist *recv_pipe;
00714
00715 char* master_buffer;
00716 size_t read_pos;
00717 size_t buf_len;
00718
00719
00720
00721
00722 curl_read_callback fread;
00723 void *fread_in;
00724
00725 struct ntlmdata ntlm;
00726 struct ntlmdata proxyntlm;
00727
00728 char syserr_buf [256];
00729
00730 #if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
00731 defined(USE_THREADING_GETADDRINFO)
00732
00733 struct Curl_async async;
00734 #endif
00735
00736
00737 char *trailer;
00738 int trlMax;
00739 int trlPos;
00740
00741 union {
00742 struct ftp_conn ftpc;
00743 struct ssh_conn sshc;
00744 } proto;
00745
00746 int cselect_bits;
00747 };
00748
00749 struct PureInfo {
00750 int httpcode;
00751 int httpproxycode;
00752 int httpversion;
00753 long filetime;
00754 long header_size;
00755 long request_size;
00756
00757 long proxyauthavail;
00758 long httpauthavail;
00759
00760 long numconnects;
00761
00762 char *contenttype;
00763 };
00764
00765 struct Progress {
00766 long lastshow;
00767 curl_off_t size_dl;
00768 curl_off_t size_ul;
00769 curl_off_t downloaded;
00770 curl_off_t uploaded;
00771
00772 curl_off_t current_speed;
00773
00774 bool callback;
00775 int width;
00776 int flags;
00777
00778 double timespent;
00779
00780 curl_off_t dlspeed;
00781 curl_off_t ulspeed;
00782
00783 double t_nslookup;
00784 double t_connect;
00785 double t_pretransfer;
00786 double t_starttransfer;
00787 double t_redirect;
00788
00789 struct timeval start;
00790 struct timeval t_startsingle;
00791 #define CURR_TIME (5+1)
00792
00793 curl_off_t speeder[ CURR_TIME ];
00794 struct timeval speeder_time[ CURR_TIME ];
00795 int speeder_c;
00796 };
00797
00798 typedef enum {
00799 HTTPREQ_NONE,
00800 HTTPREQ_GET,
00801 HTTPREQ_POST,
00802 HTTPREQ_POST_FORM,
00803 HTTPREQ_PUT,
00804 HTTPREQ_HEAD,
00805 HTTPREQ_CUSTOM,
00806 HTTPREQ_LAST
00807 } Curl_HttpReq;
00808
00809 #define MAX_CURL_USER_LENGTH 256
00810 #define MAX_CURL_PASSWORD_LENGTH 256
00811 #define MAX_CURL_USER_LENGTH_TXT "255"
00812 #define MAX_CURL_PASSWORD_LENGTH_TXT "255"
00813
00814 struct auth {
00815 long want;
00816 long picked;
00817 long avail;
00818 bool done;
00819 bool multi;
00820
00821 };
00822
00823 struct conncache {
00824
00825 struct connectdata **connects;
00826 long num;
00827 enum {
00828 CONNCACHE_PRIVATE,
00829 CONNCACHE_MULTI
00830 } type;
00831 };
00832
00833 struct UrlState {
00834 enum {
00835 Curl_if_none,
00836 Curl_if_easy,
00837 Curl_if_multi
00838 } used_interface;
00839
00840 struct conncache *connc;
00841
00842
00843 struct timeval keeps_speed;
00844
00845 long lastconnect;
00846
00847 char *headerbuff;
00848 size_t headersize;
00849
00850 char buffer[BUFSIZE+1];
00851 char uploadbuffer[BUFSIZE+1];
00852 curl_off_t current_speed;
00853 bool this_is_a_follow;
00854
00855 bool is_in_pipeline;
00856
00857 char *first_host;
00858
00859 struct curl_ssl_session *session;
00860 long sessionage;
00861
00862 char *scratch;
00863 bool errorbuf;
00864 int os_errno;
00865 #ifdef HAVE_SIGNAL
00866
00867 void (*prev_signal)(int sig);
00868 #endif
00869 bool allow_port;
00870
00871 struct digestdata digest;
00872 struct digestdata proxydigest;
00873
00874 #ifdef HAVE_GSSAPI
00875 struct negotiatedata negotiate;
00876 #endif
00877
00878 struct auth authhost;
00879 struct auth authproxy;
00880
00881 bool authproblem;
00882
00883 #ifdef USE_ARES
00884 ares_channel areschannel;
00885 #endif
00886
00887 #if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
00888 ENGINE *engine;
00889 #endif
00890 struct timeval expiretime;
00891 struct Curl_tree timenode;
00892
00893
00894 char *most_recent_ftp_entrypath;
00895
00896
00897 bool ftp_trying_alternative;
00898
00899 bool expect100header;
00900
00901 bool pipe_broke;
00902 bool cancelled;
00903
00904 #ifndef WIN32
00905
00906 #define CURL_DO_LINEEND_CONV
00907
00908 bool prev_block_had_trailing_cr;
00909
00910 curl_off_t crlf_conversions;
00911 #endif
00912
00913 void *shared_conn;
00914 bool closed;
00915 };
00916
00917 struct DynamicStatic {
00918 char *url;
00919 bool url_alloc;
00920 bool url_changed;
00921 char *referer;
00922 bool referer_alloc;
00923 struct curl_slist *cookielist;
00924 };
00925
00926 struct Curl_one_easy;
00927 struct Curl_multi;
00928
00929 struct UserDefined {
00930 FILE *err;
00931 void *debugdata;
00932 char *errorbuffer;
00933 char *proxyuserpwd;
00934 long proxyport;
00935 void *out;
00936 void *in;
00937 void *writeheader;
00938 char *set_url;
00939 char *proxy;
00940 long use_port;
00941 char *userpwd;
00942 long httpauth;
00943 long proxyauth;
00944 char *set_range;
00945 long followlocation;
00946 long maxredirs;
00947 char *set_referer;
00948 bool free_referer;
00949 char *useragent;
00950 char *encoding;
00951 char *postfields;
00952 curl_off_t postfieldsize;
00953 char *ftpport;
00954 char *device;
00955 unsigned short localport;
00956 int localportrange;
00957 curl_write_callback fwrite;
00958 curl_write_callback fwrite_header;
00959 curl_read_callback fread;
00960 curl_progress_callback fprogress;
00961 curl_debug_callback fdebug;
00962 curl_ioctl_callback ioctl;
00963 curl_sockopt_callback fsockopt;
00964 void *sockopt_client;
00965
00966
00967
00968 curl_conv_callback convfromnetwork;
00969
00970 curl_conv_callback convtonetwork;
00971
00972 curl_conv_callback convfromutf8;
00973
00974 void *progress_client;
00975 void *ioctl_client;
00976 long timeout;
00977 long connecttimeout;
00978 long ftp_response_timeout;
00979 curl_off_t infilesize;
00980 long low_speed_limit;
00981 long low_speed_time;
00982 curl_off_t max_send_speed;
00983 curl_off_t max_recv_speed;
00984 curl_off_t set_resume_from;
00985 char *cookie;
00986 struct curl_slist *headers;
00987 struct curl_httppost *httppost;
00988 char *cert;
00989 char *cert_type;
00990 char *key;
00991 char *key_type;
00992 char *key_passwd;
00993 char *cookiejar;
00994 bool cookiesession;
00995 bool crlf;
00996 char *ftp_account;
00997 char *ftp_alternative_to_user;
00998 struct curl_slist *quote;
00999 struct curl_slist *postquote;
01000 struct curl_slist *prequote;
01001 struct curl_slist *source_quote;
01002 struct curl_slist *source_prequote;
01003 struct curl_slist *source_postquote;
01004 struct curl_slist *telnet_options;
01005 curl_TimeCond timecondition;
01006 time_t timevalue;
01007 Curl_HttpReq httpreq;
01008 char *customrequest;
01009 long httpversion;
01010 char *auth_host;
01011 char *krb_level;
01012 struct ssl_config_data ssl;
01013
01014 curl_proxytype proxytype;
01015
01016 int dns_cache_timeout;
01017 long buffer_size;
01018
01019 char *private_data;
01020
01021 struct Curl_one_easy *one_easy;
01022
01023 struct curl_slist *http200aliases;
01024
01025 long ip_version;
01026
01027 curl_off_t max_filesize;
01028
01029 char *source_url;
01030 char *source_userpwd;
01031
01032 curl_ftpfile ftp_filemethod;
01033
01034 bool printhost;
01035 bool get_filetime;
01036 bool tunnel_thru_httpproxy;
01037 bool prefer_ascii;
01038 bool ftp_append;
01039 bool ftp_list_only;
01040 bool ftp_create_missing_dirs;
01041 bool ftp_use_port;
01042 bool hide_progress;
01043 bool http_fail_on_error;
01044 bool http_follow_location;
01045 bool http_disable_hostname_check_before_authentication;
01046 bool include_header;
01047 bool http_set_referer;
01048 bool http_auto_referer;
01049 bool opt_no_body;
01050 bool set_port;
01051 bool upload;
01052 enum CURL_NETRC_OPTION
01053 use_netrc;
01054 char *netrc_file;
01055 bool verbose;
01056 bool krb;
01057 bool reuse_forbid;
01058 bool reuse_fresh;
01059 bool ftp_use_epsv;
01060 bool ftp_use_eprt;
01061
01062 curl_ftpssl ftp_ssl;
01063 curl_ftpauth ftpsslauth;
01064 curl_ftpccc ftp_ccc;
01065 bool no_signal;
01066 bool global_dns_cache;
01067 bool tcp_nodelay;
01068 bool ignorecl;
01069 bool ftp_skip_ip;
01070 bool connect_only;
01071 long ssh_auth_types;
01072 char *ssh_public_key;
01073 char *ssh_private_key;
01074 bool http_te_skip;
01075 bool http_ce_skip;
01076 long new_file_perms;
01077 long new_directory_perms;
01078 };
01079
01080 struct Names {
01081 struct curl_hash *hostcache;
01082 enum {
01083 HCACHE_NONE,
01084 HCACHE_PRIVATE,
01085 HCACHE_GLOBAL,
01086 HCACHE_MULTI,
01087 HCACHE_SHARED
01088 } hostcachetype;
01089 };
01090
01091 struct SessionHandle {
01092 struct Names dns;
01093 struct Curl_multi *multi;
01094 struct Curl_one_easy *multi_pos;
01095 struct Curl_share *share;
01096 struct HandleData reqdata;
01097 struct UserDefined set;
01098 struct DynamicStatic change;
01099
01100 struct CookieInfo *cookies;
01101 struct Progress progress;
01102 struct UrlState state;
01103 struct PureInfo info;
01104 #if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
01105 iconv_t outbound_cd;
01106 iconv_t inbound_cd;
01107 iconv_t utf8_cd;
01108 #endif
01109 unsigned int magic;
01110 };
01111
01112 #define LIBCURL_NAME "libcurl"
01113
01114 #endif