⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urldata.h

📁 harvest是一个下载html网页得机器人
💻 H
📖 第 1 页 / 共 3 页
字号:
  int width; /* screen width at download start */  int flags; /* see progress.h */  double timespent;  double dlspeed;  double ulspeed;  double t_nslookup;  double t_connect;  double t_pretransfer;  double t_starttransfer;  double t_redirect;  struct timeval start;  struct timeval t_startsingle;#define CURR_TIME (5+1) /* 6 entries for 5 seconds */  double speeder[ CURR_TIME ];  struct timeval speeder_time[ CURR_TIME ];  int speeder_c;};typedef enum {  HTTPREQ_NONE, /* first in list */  HTTPREQ_GET,  HTTPREQ_POST,  HTTPREQ_POST_FORM, /* we make a difference internally */  HTTPREQ_PUT,  HTTPREQ_CUSTOM,  HTTPREQ_LAST /* last in list */} Curl_HttpReq;/* * Values that are generated, temporary or calculated internally for a * "session handle" must be defined within the 'struct urlstate'.  This struct * will be used within the SessionHandle struct. When the 'SessionHandle' * struct is cloned, this data MUST NOT be copied. * * Remember that any "state" information goes globally for the curl handle. * Session-data MUST be put in the connectdata struct and here.  */#define MAX_CURL_USER_LENGTH 256#define MAX_CURL_PASSWORD_LENGTH 256#define MAX_CURL_USER_LENGTH_TXT "255"#define MAX_CURL_PASSWORD_LENGTH_TXT "255"struct UrlState {  enum {    Curl_if_none,    Curl_if_easy,    Curl_if_multi  } used_interface;  /* buffers to store authentication data in, as parsed from input options */  struct timeval keeps_speed; /* for the progress meter really */  /* 'connects' will be an allocated array with pointers. If the pointer is     set, it holds an allocated connection. */  struct connectdata **connects;  long numconnects; /* size of the 'connects' array */  char *headerbuff; /* allocated buffer to store headers in */  int headersize;   /* size of the allocation */  char buffer[BUFSIZE+1]; /* download buffer */  char uploadbuffer[BUFSIZE+1]; /* upload buffer */  double current_speed;  /* the ProgressShow() funcion sets this */  bool this_is_a_follow; /* this is a followed Location: request */  char *auth_host; /* if set, this should be the host name that we will                      sent authorization to, no else. Used to make Location:                      following not keep sending user+password... This is                      strdup() data.                    */  struct curl_ssl_session *session; /* array of 'numsessions' size */  long sessionage;                  /* number of the most recent session */  char *scratch; /* huge buffer[BUFSIZE*2] when doing upload CRLF replacing */  bool errorbuf; /* Set to TRUE if the error buffer is already filled in.                    This must be set to FALSE every time _easy_perform() is                    called. */#ifdef HAVE_SIGNAL  /* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */  void (*prev_signal)(int sig);#endif  bool allow_port; /* Is set.use_port allowed to take effect or not. This                      is always set TRUE when curl_easy_perform() is called. */  struct digestdata digest;#ifdef HAVE_GSSAPI  struct negotiatedata negotiate;#endif  long authstage; /*   0 - authwant and authavail are still not initialized                     401 - web authentication is performed                     407 - proxy authentication is performed */  long authwant;  /* initially set to authentication methods requested by                     client (either with CURLOPT_HTTPAUTH or CURLOPT_PROXYAUTH                     depending on authstage) */  long authavail; /* what the server reports */#ifdef USE_ARES  ares_channel areschannel; /* for name resolves */#endif};/* * 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 */  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 */  struct curl_slist *cookielist; /* list of cookie files set by                                    curl_easy_setopt(COOKIEFILE) calls */};/* * This 'UserDefined' struct must only contain data that is set once to go * for many (perhaps) independent connections. Values that are generated or * calculated internally for the "session handle" MUST be defined within the * 'struct urlstate' instead. The only exceptions MUST note the changes in * the 'DynamicStatic' struct. */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                     this. */    void *out;         /* the fetched file goes here */  void *in;          /* the uploaded file is read from here */  void *writeheader; /* write the header to this is non-NULL */  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) */  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 */  char *set_referer; /* custom string */  bool free_referer; /* set TRUE if 'referer' points to a string we                        allocated */  char *useragent;   /* User-Agent string */  char *encoding;    /* Accept-Encoding string */  char *postfields;  /* if POST, set the fields' values here */  size_t postfieldsize; /* if POST, this might have a size to use instead of                           strlen(), and then the data *may* be binary (contain                           zero bytes) */  char *ftpport;     /* port to send with the FTP PORT command */  char *device;      /* network interface to use */  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 */  void *progress_client; /* pointer to pass to the progress callback */  curl_passwd_callback fpasswd;      /* call for password */  void *passwd_client;               /* pass to the passwd callback */  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 */  long infilesize;      /* size of file to upload, -1 means unknown */  long low_speed_limit; /* bytes/second */  long low_speed_time;  /* number of seconds */  int set_resume_from;  /* continue [ftp] transfer from here */  char *cookie;         /* HTTP cookie string to send */  struct curl_slist *headers; /* linked list of extra headers */  struct 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 */  char *crypto_engine;  /* name of the crypto engine to use */  char *cookiejar;      /* dump all cookies to this file */  bool cookiesession;   /* new cookie session? */  bool crlf;            /* convert crlf on ftp upload(?) */  struct curl_slist *quote;     /* after connection is established */  struct curl_slist *postquote; /* after the transfer */  struct curl_slist *prequote; /* before the transfer, after type (Wesley Laxton)*/  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 */  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) */  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 */  struct ssl_config_data ssl;  /* user defined SSL stuff */  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 */  char *private; /* Private data */  struct curl_slist *http200aliases; /* linked list of aliases for http200 */  int ip_version;   long max_filesize; /* Maximum file size to download */  /* 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 get_filetime;  bool tunnel_thru_httpproxy;  bool ftp_append;  bool ftp_ascii;  bool ftp_list_only;  bool ftp_create_missing_dirs;  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;#define http_include_header include_header /* former name */  bool http_set_referer;  bool http_auto_referer; /* set "correct" referer when following location: */  bool no_body;  bool set_port;  bool upload;  enum CURL_NETRC_OPTION       use_netrc;        /* defined in include/curl.h */  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 expect100header;  /* TRUE if we added Expect: 100-continue */  bool ftp_use_epsv;     /* if EPSV is to be attempted or not */  bool ftp_use_eprt;     /* if EPRT is to be attempted or not */  bool no_signal;        /* do not use any signal/alarm handler */  bool global_dns_cache;};/* * In August 2001, this struct was redesigned and is since stricter than * before. The 'connectdata' struct MUST have all the connection oriented * stuff as we may now have several simultaneous connections and connection * structs in memory. * * From now on, the 'SessionHandle' must only contain data that is set once to * go for many (perhaps) independent connections. Values that are generated or * calculated internally for the "session handle" must be defined within the * 'struct urlstate' instead.  */struct SessionHandle {  curl_hash *hostcache;  struct Curl_share *share;    /* Share, handles global variable mutexing */  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(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)  ENGINE*  engine;#endif /* USE_SSLEAY */};#define LIBCURL_NAME "libcurl"#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -