- shrunk the BUFSIZE define from 50K to 20K
[platform/upstream/curl.git] / lib / urldata.h
1 #ifndef __URLDATA_H
2 #define __URLDATA_H
3 /*****************************************************************************
4  *                                  _   _ ____  _     
5  *  Project                     ___| | | |  _ \| |    
6  *                             / __| | | | |_) | |    
7  *                            | (__| |_| |  _ <| |___ 
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 2001, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * In order to be useful for every potential user, curl and libcurl are
13  * dual-licensed under the MPL and the MIT/X-derivate licenses.
14  *
15  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
16  * copies of the Software, and permit persons to whom the Software is
17  * furnished to do so, under the terms of the MPL or the MIT/X-derivate
18  * licenses. You may pick one of these licenses.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * $Id$
24  *****************************************************************************/
25
26 /* This file is for lib internal stuff */
27
28 #include "setup.h"
29 #include "hostip.h"
30 #include "hash.h"
31
32 #define PORT_FTP 21
33 #define PORT_TELNET 23
34 #define PORT_GOPHER 70
35 #define PORT_HTTP 80
36 #define PORT_HTTPS 443
37 #define PORT_DICT 2628
38 #define PORT_LDAP 389
39
40 #define DICT_MATCH "/MATCH:"
41 #define DICT_MATCH2 "/M:"
42 #define DICT_MATCH3 "/FIND:"
43 #define DICT_DEFINE "/DEFINE:"
44 #define DICT_DEFINE2 "/D:"
45 #define DICT_DEFINE3 "/LOOKUP:"
46
47 #define CURL_DEFAULT_USER "anonymous"
48 #define CURL_DEFAULT_PASSWORD "curl_by_daniel@haxx.se"
49
50 #include "cookie.h"
51 #include "formdata.h"
52     
53 #ifdef USE_SSLEAY
54 /* SSLeay stuff usually in /usr/local/ssl/include */
55 #ifdef USE_OPENSSL
56 #include "openssl/rsa.h"
57 #include "openssl/crypto.h"
58 #include "openssl/x509.h"
59 #include "openssl/pem.h"
60 #include "openssl/ssl.h"
61 #include "openssl/err.h"
62 #ifdef HAVE_OPENSSL_ENGINE_H
63 #include <openssl/engine.h>
64 #endif
65 #else
66 #include "rsa.h"
67 #include "crypto.h"
68 #include "x509.h"
69 #include "pem.h"
70 #include "ssl.h"
71 #include "err.h"
72 #endif
73 #endif
74
75 #ifdef HAVE_NETINET_IN_H
76 #include <netinet/in.h>
77 #endif
78
79 #include "timeval.h"
80
81 #include <curl/curl.h>
82
83 #include "http_chunks.h" /* for the structs and enum stuff */
84
85 /* Download buffer size, keep it fairly big for speed reasons */
86 #define BUFSIZE (1024*20)
87
88 /* Defaul upload buffer size, keep it smallish to get faster progress meter
89    updates. This is just default, it is dynamic and adjusts to the upload
90    speed. */
91 #define UPLOAD_BUFSIZE (1024*2)
92
93 /* Initial size of the buffer to store headers in, it'll be enlarged in case
94    of need. */
95 #define HEADERSIZE 256
96
97 /* Just a convenience macro to get the larger value out of two given */
98 #ifndef MAX
99 #define MAX(x,y) ((x)>(y)?(x):(y))
100 #endif
101
102 #ifdef KRB4
103 /* Types needed for krb4-ftp connections */
104 struct krb4buffer {
105   void *data;
106   size_t size;
107   size_t index;
108   int eof_flag;
109 };
110 enum protection_level { 
111     prot_clear, 
112     prot_safe, 
113     prot_confidential, 
114     prot_private 
115 };
116 #endif
117
118 #ifndef HAVE_OPENSSL_ENGINE_H
119 typedef void ENGINE;
120 #endif
121 /* struct for data related to SSL and SSL connections */
122 struct ssl_connect_data {
123   bool use;              /* use ssl encrypted communications TRUE/FALSE */
124 #ifdef USE_SSLEAY
125   /* these ones requires specific SSL-types */
126   SSL_CTX* ctx;
127   SSL*     handle;
128   X509*    server_cert;
129 #endif /* USE_SSLEAY */
130 };
131
132 /* information about one single SSL session */
133 struct curl_ssl_session {
134   char *name;       /* host name for which this ID was used */
135   void *sessionid;  /* as returned from the SSL layer */
136   long age;         /* just a number, the higher the more recent */
137   unsigned short remote_port; /* remote port to connect to */
138 };
139
140 struct ssl_config_data {
141   long version;          /* what version the client wants to use */
142   long certverifyresult; /* result from the certificate verification */
143   long verifypeer;       /* set TRUE if this is desired */
144   long verifyhost;       /* 0: no verif, 1: check that CN exists, 2: CN must match hostname */
145   char *CApath;          /* DOES NOT WORK ON WINDOWS */
146   char *CAfile;          /* cerficate to verify peer against */
147   char *random_file;     /* path to file containing "random" data */
148   char *egdsocket;       /* path to file containing the EGD daemon socket */
149   char *cipher_list;     /* list of ciphers to use */
150
151   long numsessions;                 /* SSL session id cache size */
152 };
153
154 /****************************************************************************
155  * HTTP unique setup
156  ***************************************************************************/
157 struct HTTP {
158   struct FormData *sendit;
159   int postsize;
160   const char *p_pragma;      /* Pragma: string */
161   const char *p_accept;      /* Accept: string */
162   long readbytecount; 
163   long writebytecount;
164
165   /* For FORM posting */
166   struct Form form;
167   curl_read_callback storefread;
168   FILE *in;
169
170   struct Curl_chunker chunk;
171 };
172
173 /****************************************************************************
174  * FTP unique setup
175  ***************************************************************************/
176 struct FTP {
177   long *bytecountp;
178   char *user;    /* user name string */
179   char *passwd;  /* password string */
180   char *urlpath; /* the originally given path part of the URL */
181   char *dir;     /* decoded directory */
182   char *file;    /* decoded file */
183
184   char *entrypath; /* the PWD reply when we logged on */
185
186   char *cache;       /* data cache between getresponse()-calls */
187   size_t cache_size; /* size of cache in bytes */                    
188 };
189
190 /****************************************************************************
191  * FILE unique setup
192  ***************************************************************************/
193 struct FILE {
194   int fd; /* open file descriptor to read from! */
195 };
196
197 /*
198  * Boolean values that concerns this connection.
199  */
200 struct ConnectBits {
201   bool close; /* if set, we close the connection after this request */
202   bool reuse; /* if set, this is a re-used connection */
203   bool chunk; /* if set, this is a chunked transfer-encoding */
204   bool httpproxy;    /* if set, this transfer is done through a http proxy */
205   bool user_passwd;    /* do we use user+password for this connection? */
206   bool proxy_user_passwd; /* user+password for the proxy? */
207
208   bool use_range;
209   bool rangestringalloc; /* the range string is malloc()'ed */
210
211   bool resume_done; /* nothing was transfered, resumed transfer already
212                        complete */
213 };
214
215 /*
216  * This struct is all the previously local variables from Curl_perform() moved
217  * to struct to allow the function to return and get re-invoked better without
218  * losing state.
219  */
220
221 struct Curl_transfer_keeper {
222   int bytecount;                /* total number of bytes read */
223   int writebytecount;           /* number of bytes written */
224   long contentlength;           /* size of incoming data */
225   struct timeval start;         /* transfer started at this time */
226   struct timeval now;           /* current time */
227   bool header;                  /* incoming data has HTTP header */
228   int headerline;               /* counts header lines to better track the
229                                    first one */
230   char *hbufp;                  /* points at *end* of header line */
231   int hbuflen;
232   char *str;                    /* within buf */
233   char *str_start;              /* within buf */
234   char *end_ptr;                /* within buf */
235   char *p;                      /* within headerbuff */
236   bool content_range;           /* set TRUE if Content-Range: was found */
237   int offset;                   /* possible resume offset read from the
238                                    Content-Range: header */
239   int httpcode;                 /* error code from the 'HTTP/1.? XXX' line */
240   int httpversion;              /* the HTTP version*10 */
241   bool write_after_100_header;  /* should we enable the write after
242                                    we received a 100-continue/timeout
243                                    or directly */
244
245   /* for the low speed checks: */
246   time_t timeofdoc;
247   long bodywrites;
248   int writetype;
249
250   /* the highest fd we use + 1 */
251   struct SessionHandle *data;
252   struct connectdata *conn;
253   char *buf;
254   char *uploadbuf;
255   int maxfd;
256
257   /* the file descriptors to play with */
258   fd_set readfd;
259   fd_set writefd;
260   fd_set rkeepfd;
261   fd_set wkeepfd;
262   int keepon;
263
264 };
265
266
267 /*
268  * The connectdata struct contains all fields and variables that should be
269  * unique for an entire connection.
270  */
271 struct connectdata {
272   /**** Fields set when inited and not modified again */
273   struct SessionHandle *data; /* link to the root CURL struct */
274   int connectindex; /* what index in the connects index this particular
275                        struct has */
276
277   long protocol; /* PROT_* flags concerning the protocol set */
278 #define PROT_MISSING (1<<0)
279 #define PROT_GOPHER  (1<<1)
280 #define PROT_HTTP    (1<<2)
281 #define PROT_HTTPS   (1<<3)
282 #define PROT_FTP     (1<<4)
283 #define PROT_TELNET  (1<<5)
284 #define PROT_DICT    (1<<6)
285 #define PROT_LDAP    (1<<7)
286 #define PROT_FILE    (1<<8)
287 #define PROT_FTPS    (1<<9)
288 #define PROT_SSL     (1<<10) /* protocol requires SSL */
289
290   Curl_addrinfo *hostaddr; /* IP-protocol independent host info pointer list */
291   char *hostent_buf; /* pointer to allocated memory for name info */
292
293 #ifdef ENABLE_IPV6
294   struct addrinfo *serv_addr;   /* the particular host we use */
295 #else
296   struct sockaddr_in serv_addr;
297 #endif
298   char protostr[64];  /* store the protocol string in this buffer */
299   char gname[513]; /* store the hostname in this buffer */
300   char *name;      /* host name pointer to fool around with */
301   char *path;      /* allocated buffer to store the URL's path part in */
302   char *hostname;  /* hostname to connect, as parsed from url */
303   long port;       /* which port to use locally */
304   unsigned short remote_port; /* what remote port to connect to,
305                                  not the proxy port! */
306   char *ppath;
307   long bytecount;
308   long headerbytecount;  /* only count received headers */
309
310   char *range; /* range, if used. See README for detailed specification on
311                   this syntax. */
312   ssize_t resume_from; /* continue [ftp] transfer from here */
313
314   char *proxyhost; /* name of the http proxy host */
315
316   struct timeval now;     /* "current" time */
317   struct timeval created; /* creation time */
318   int firstsocket;     /* the main socket to use */
319   int secondarysocket; /* for i.e ftp transfers */
320
321   long upload_bufsize; /* adjust as you see fit, never bigger than BUFSIZE
322                           never smaller than UPLOAD_BUFSIZE */
323
324   long maxdownload; /* in bytes, the maximum amount of data to fetch, 0
325                        means unlimited */
326   
327   struct ssl_connect_data ssl; /* this is for ssl-stuff */
328
329   struct ConnectBits bits;    /* various state-flags for this connection */
330
331   /* These two functions MUST be set by the curl_connect() function to be
332      be protocol dependent */
333   CURLcode (*curl_do)(struct connectdata *connect);
334   CURLcode (*curl_done)(struct connectdata *connect);
335
336   /* This function *MAY* be set to a protocol-dependent function that is run
337    * after the connect() and everything is done, as a step in the connection.
338    */ 
339   CURLcode (*curl_connect)(struct connectdata *connect);
340
341   /* This function *MAY* be set to a protocol-dependent function that is run
342    * by the curl_disconnect(), as a step in the disconnection.
343    */ 
344   CURLcode (*curl_disconnect)(struct connectdata *connect);
345
346   /* This function *MAY* be set to a protocol-dependent function that is run
347    * in the curl_close() function if protocol-specific cleanups are required.
348    */ 
349   CURLcode (*curl_close)(struct connectdata *connect);
350
351   /**** curl_get() phase fields */
352
353   /* READ stuff */
354   int sockfd;            /* socket to read from or -1 */
355   int size;              /* -1 if unknown at this point */
356   bool getheader;        /* TRUE if header parsing is wanted */
357   long *bytecountp;      /* return number of bytes read or NULL */
358           
359   /* WRITE stuff */
360   int writesockfd;       /* socket to write to, it may very well be
361                             the same we read from. -1 disables */
362   long *writebytecountp; /* return number of bytes written or NULL */
363
364   /** Dynamicly allocated strings, may need to be freed before this **/
365   /** struct is killed.                                             **/
366   struct dynamically_allocated_data {
367     char *proxyuserpwd; /* free later if not NULL! */
368     char *uagent; /* free later if not NULL! */
369     char *userpwd; /* free later if not NULL! */
370     char *rangeline; /* free later if not NULL! */
371     char *ref; /* free later if not NULL! */
372     char *cookie; /* free later if not NULL! */
373     char *host; /* free later if not NULL */
374   } allocptr;
375
376   char *newurl; /* This can only be set if a Location: was in the
377                    document headers */
378
379 #ifdef KRB4
380   enum protection_level command_prot;
381   enum protection_level data_prot;
382   enum protection_level request_data_prot;
383
384   size_t buffer_size;
385
386   struct krb4buffer in_buffer, out_buffer;
387   int sec_complete;
388   void *app_data;
389
390   struct Curl_sec_client_mech *mech;
391   struct sockaddr_in local_addr;
392
393 #endif
394
395   /*************** Request - specific items ************/
396   /* previously this was in the urldata struct */
397   union {
398     struct HTTP *http;
399     struct HTTP *gopher; /* alias, just for the sake of being more readable */
400     struct HTTP *https;  /* alias, just for the sake of being more readable */
401     struct FTP *ftp;
402     struct FILE *file;
403     void *telnet;        /* private for telnet.c-eyes only */
404 #if 0 /* no need for special ones for these: */
405     struct LDAP *ldap;
406     struct DICT *dict;
407 #endif
408     void *generic;
409   } proto;
410
411   /* This struct is inited when needed */
412   struct Curl_transfer_keeper keep;
413
414   /* 'upload_present' is used to keep a byte counter of how much data there is
415      still left in the buffer, aimed for upload. */
416   int upload_present;
417
418    /* 'upload_fromhere' is used as a read-pointer when we uploaded parts of a
419       buffer, so the next read should read from where this pointer points to,
420       and the 'upload_present' contains the number of bytes available at this
421       position */
422   char *upload_fromhere;                                   
423 };
424
425 /*
426  * Struct to keep statistical and informational data.
427  */
428 struct PureInfo {
429   int httpcode;
430   int httpversion;
431   long filetime; /* If requested, this is might get set. Set to -1 if
432                     the time was unretrievable */
433   long header_size;  /* size of read header(s) in bytes */
434   long request_size; /* the amount of bytes sent in the request(s) */
435 };
436
437
438 struct Progress {
439   long lastshow; /* time() of the last displayed progress meter or NULL to
440                     force redraw at next call */
441   double size_dl;
442   double size_ul;
443   double downloaded;
444   double uploaded;
445
446   double current_speed; /* uses the currently fastest transfer */
447
448   bool callback;  /* set when progress callback is used */
449   int width; /* screen width at download start */
450   int flags; /* see progress.h */
451
452   double timespent;
453
454   double dlspeed;
455   double ulspeed;
456
457   double t_nslookup;
458   double t_connect;
459   double t_pretransfer;
460   double t_starttransfer;
461
462   struct timeval start;
463   struct timeval t_startsingle;
464 #define CURR_TIME (5+1) /* 6 entries for 5 seconds */
465
466   double speeder[ CURR_TIME ];
467   struct timeval speeder_time[ CURR_TIME ];
468   int speeder_c;
469 };
470
471 typedef enum {
472   HTTPREQ_NONE, /* first in list */
473   HTTPREQ_GET,
474   HTTPREQ_POST,
475   HTTPREQ_POST_FORM, /* we make a difference internally */
476   HTTPREQ_PUT,
477   HTTPREQ_CUSTOM,
478   HTTPREQ_LAST /* last in list */
479 } Curl_HttpReq;
480
481 /*
482  * Values that are generated, temporary or calculated internally for a
483  * "session handle" must be defined within the 'struct urlstate'.  This struct
484  * will be used within the SessionHandle struct. When the 'SessionHandle'
485  * struct is cloned, this data MUST NOT be copied.
486  *
487  * Remember that any "state" information goes globally for the curl handle.
488  * Session-data MUST be put in the connectdata struct and here.  */
489 #define MAX_CURL_USER_LENGTH 256
490 #define MAX_CURL_PASSWORD_LENGTH 256
491
492 struct UrlState {
493   /* buffers to store authentication data in, as parsed from input options */
494   char user[MAX_CURL_USER_LENGTH];
495   char passwd[MAX_CURL_PASSWORD_LENGTH];
496   char proxyuser[MAX_CURL_USER_LENGTH];
497   char proxypasswd[MAX_CURL_PASSWORD_LENGTH];
498
499   struct timeval keeps_speed; /* for the progress meter really */
500
501   /* 'connects' will be an allocated array with pointers. If the pointer is
502      set, it holds an allocated connection. */
503   struct connectdata **connects;
504   long numconnects; /* size of the 'connects' array */
505
506   char *headerbuff; /* allocated buffer to store headers in */
507   int headersize;   /* size of the allocation */
508
509   char buffer[BUFSIZE+1]; /* download buffer */
510   char uploadbuffer[BUFSIZE+1]; /* upload buffer */
511   double current_speed;  /* the ProgressShow() funcion sets this */
512
513   bool this_is_a_follow; /* this is a followed Location: request */
514
515   char *auth_host; /* if set, this should be the host name that we will
516                       sent authorization to, no else. Used to make Location:
517                       following not keep sending user+password... This is
518                       strdup() data.
519                     */
520
521   struct curl_ssl_session *session; /* array of 'numsessions' size */
522   long sessionage;                  /* number of the most recent session */
523
524   char scratch[BUFSIZE*2]; /* huge buffer when doing upload CRLF replacing */
525   bool errorbuf; /* Set to TRUE if the error buffer is already filled in.
526                     This must be set to FALSE every time _easy_perform() is
527                     called. */
528
529 #ifdef HAVE_SIGNAL
530   /* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */
531   void (*prev_signal)(int sig);
532 #endif
533   bool allow_port; /* Is set.use_port allowed to take effect or not. This
534                       is always set TRUE when curl_easy_perform() is called. */
535 };
536
537
538 /*
539  * This 'DynamicStatic' struct defines dynamic states that actually change
540  * values in the 'UserDefined' area, which MUST be taken into consideration
541  * if the UserDefined struct is cloned or similar. You can probably just
542  * copy these, but each one indicate a special action on other data.
543  */
544
545 struct DynamicStatic {
546   char *url;        /* work URL, copied from UserDefined */
547   bool url_alloc;   /* URL string is malloc()'ed */
548   char *proxy;      /* work proxy, copied from UserDefined */
549   bool proxy_alloc; /* http proxy string is malloc()'ed */
550   char *referer;    /* referer string */
551   bool referer_alloc; /* referer sting is malloc()ed */
552 };
553
554 /*
555  * This 'UserDefined' struct must only contain data that is set once to go
556  * for many (perhaps) independent connections. Values that are generated or
557  * calculated internally for the "session handle" MUST be defined within the
558  * 'struct urlstate' instead. The only exceptions MUST note the changes in
559  * the 'DynamicStatic' struct.
560  */
561
562 struct UserDefined {
563   FILE *err;    /* the stderr writes goes here */
564   char *errorbuffer; /* store failure messages in here */
565   char *proxyuserpwd;  /* Proxy <user:password>, if used */
566   long proxyport; /* If non-zero, use this port number by default. If the
567                      proxy string features a ":[port]" that one will override
568                      this. */  
569   void *out;         /* the fetched file goes here */
570   void *in;          /* the uploaded file is read from here */
571   void *writeheader; /* write the header to this is non-NULL */
572   char *set_url;     /* what original URL to work on */
573   char *set_proxy;   /* proxy to use */
574   long use_port;     /* which port to use (when not using default) */
575   char *userpwd;     /* <user:password>, if used */
576   char *set_range;   /* range, if used. See README for detailed specification
577                         on this syntax. */
578   long followlocation; /* as in HTTP Location: */
579   long maxredirs;    /* maximum no. of http(s) redirects to follow */
580   char *set_referer; /* custom string */
581   bool free_referer; /* set TRUE if 'referer' points to a string we
582                         allocated */
583   char *useragent;   /* User-Agent string */
584   char *postfields;  /* if POST, set the fields' values here */
585   size_t postfieldsize; /* if POST, this might have a size to use instead of
586                            strlen(), and then the data *may* be binary (contain
587                            zero bytes) */
588   char *ftpport;     /* port to send with the FTP PORT command */
589   char *device;      /* network interface to use */
590   curl_write_callback fwrite;        /* function that stores the output */
591   curl_write_callback fwrite_header; /* function that stores headers */
592   curl_read_callback fread;          /* function that reads the input */
593   curl_progress_callback fprogress;  /* function for progress information */
594   void *progress_client; /* pointer to pass to the progress callback */
595   curl_passwd_callback fpasswd;      /* call for password */
596   void *passwd_client;               /* pass to the passwd callback */
597   long timeout;         /* in seconds, 0 means no timeout */
598   long connecttimeout;  /* in seconds, 0 means no timeout */
599   long infilesize;      /* size of file to upload, -1 means unknown */
600   long low_speed_limit; /* bytes/second */
601   long low_speed_time;  /* number of seconds */
602   int set_resume_from;  /* continue [ftp] transfer from here */
603   char *cookie;         /* HTTP cookie string to send */
604   struct curl_slist *headers; /* linked list of extra headers */
605   struct HttpPost *httppost;  /* linked list of POST data */
606   char *cert;           /* certificate */
607   char *cert_type;      /* format for certificate (default: PEM) */
608   char *key;            /* private key */
609   char *key_type;       /* format for private key (default: PEM) */
610   char *key_passwd;     /* plain text private key password */
611   char *crypto_engine;  /* name of the crypto engine to use */
612   char *cookiejar;      /* dump all cookies to this file */
613   bool crlf;            /* convert crlf on ftp upload(?) */
614   struct curl_slist *quote;     /* before the transfer */
615   struct curl_slist *postquote; /* after the transfer */
616   struct curl_slist *telnet_options; /* linked list of telnet options */
617   curl_TimeCond timecondition; /* kind of time/date comparison */
618   time_t timevalue;       /* what time to compare with */
619   curl_closepolicy closepolicy; /* connection cache close concept */
620   Curl_HttpReq httpreq;   /* what kind of HTTP request (if any) is this */
621   char *customrequest;    /* HTTP/FTP request to use */
622   long httpversion; /* when non-zero, a specific HTTP version requested to
623                        be used in the library's request(s) */
624   char *auth_host; /* if set, this is the allocated string to the host name
625                     * to which to send the authorization data to, and no other
626                     * host (which location-following otherwise could lead to)
627                     */
628   char *krb4_level; /* what security level */
629   struct ssl_config_data ssl;  /* user defined SSL stuff */
630
631   int dns_cache_timeout; /* DNS cache timeout */
632   
633 /* Here follows boolean settings that define how to behave during
634    this session. They are STATIC, set by libcurl users or at least initially
635    and they don't change during operations. */
636
637   bool get_filetime;
638   bool tunnel_thru_httpproxy;
639   bool ftp_append;
640   bool ftp_ascii;
641   bool ftp_list_only;
642   bool ftp_use_port;
643   bool hide_progress;
644   bool http_fail_on_error;
645   bool http_follow_location;
646   bool include_header;
647 #define http_include_header include_header /* former name */
648
649   bool http_set_referer;
650   bool http_auto_referer; /* set "correct" referer when following location: */
651   bool no_body;
652   bool set_port;
653   bool upload;
654   bool use_netrc;
655   bool verbose;
656   bool krb4;             /* kerberos4 connection requested */
657   bool reuse_forbid;     /* forbidden to be reused, close after use */
658   bool reuse_fresh;      /* do not re-use an existing connection  */
659   bool expect100header;  /* TRUE if we added Expect: 100-continue */
660   bool ftp_use_epsv;     /* if EPSV is to be attempted or not */
661
662   bool global_dns_cache;
663 };
664
665 /*
666  * In August 2001, this struct was redesigned and is since stricter than
667  * before. The 'connectdata' struct MUST have all the connection oriented
668  * stuff as we may now have several simultaneous connections and connection
669  * structs in memory.
670  *
671  * From now on, the 'SessionHandle' must only contain data that is set once to
672  * go for many (perhaps) independent connections. Values that are generated or
673  * calculated internally for the "session handle" must be defined within the
674  * 'struct urlstate' instead.  */
675
676 struct SessionHandle {
677   curl_hash          *hostcache;
678   struct UserDefined set;      /* values set by the libcurl user */
679   struct DynamicStatic change; /* possibly modified userdefined data */
680
681   struct CookieInfo *cookies;  /* the cookies, read from files and servers */
682   struct Progress progress;    /* for all the progress meter data */
683   struct UrlState state;       /* struct for fields used for state info and
684                                   other dynamic purposes */
685   struct PureInfo info;        /* stats, reports and info data */
686 #ifdef USE_SSLEAY
687   ENGINE*  engine;
688 #endif /* USE_SSLEAY */
689 };
690
691 #define LIBCURL_NAME "libcurl"
692
693 #endif