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