📄 urldata.h
字号:
#ifndef __URLDATA_H#define __URLDATA_H/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id: urldata.h,v 1.180 2003/10/18 20:14:33 bagder Exp $ ***************************************************************************//* This file is for lib internal stuff */#include "setup.h"#define PORT_FTP 21#define PORT_TELNET 23#define PORT_GOPHER 70#define PORT_HTTP 80#define PORT_HTTPS 443#define PORT_DICT 2628#define PORT_LDAP 389#define DICT_MATCH "/MATCH:"#define DICT_MATCH2 "/M:"#define DICT_MATCH3 "/FIND:"#define DICT_DEFINE "/DEFINE:"#define DICT_DEFINE2 "/D:"#define DICT_DEFINE3 "/LOOKUP:"#define CURL_DEFAULT_USER "anonymous"#define CURL_DEFAULT_PASSWORD "curl_by_daniel@haxx.se"#include "cookie.h"#include "formdata.h" #ifdef USE_SSLEAY/* SSLeay stuff usually in /usr/local/ssl/include */#ifdef USE_OPENSSL#include "openssl/rsa.h"#include "openssl/crypto.h"#include "openssl/x509.h"#include "openssl/pem.h"#include "openssl/ssl.h"#include "openssl/err.h"#ifdef HAVE_OPENSSL_ENGINE_H#include <openssl/engine.h>#endif#else#include "rsa.h"#include "crypto.h"#include "x509.h"#include "pem.h"#include "ssl.h"#include "err.h"#endif#endif#ifdef HAVE_NETINET_IN_H#include <netinet/in.h>#endif#include "timeval.h"#include <curl/curl.h>#include "http_chunks.h" /* for the structs and enum stuff */#include "hostip.h"#include "hash.h"#ifdef HAVE_ZLIB_H#include <zlib.h> /* for content-encoding */#endif#ifdef HAVE_GSSAPI#ifdef HAVE_GSSMIT#include <gssapi/gssapi.h>#include <gssapi/gssapi_generic.h>#else#include <gssapi.h>#endif#endif#ifdef USE_ARES#include <ares.h>#endif/* Download buffer size, keep it fairly big for speed reasons */#define BUFSIZE CURL_MAX_WRITE_SIZE/* Initial size of the buffer to store headers in, it'll be enlarged in case of need. */#define HEADERSIZE 256/* Maximum number of dirs supported by libcurl in a FTP dir hierarchy */#define CURL_MAX_FTP_DIRDEPTH 100/* Just a convenience macro to get the larger value out of two given */#ifndef MAX#define MAX(x,y) ((x)>(y)?(x):(y))#endif#ifdef KRB4/* Types needed for krb4-ftp connections */struct krb4buffer { void *data; size_t size; size_t index; int eof_flag;};enum protection_level { prot_clear, prot_safe, prot_confidential, prot_private };#endif/* struct for data related to SSL and SSL connections */struct ssl_connect_data { bool use; /* use ssl encrypted communications TRUE/FALSE */#ifdef USE_SSLEAY /* these ones requires specific SSL-types */ SSL_CTX* ctx; SSL* handle; X509* server_cert;#endif /* USE_SSLEAY */};struct ssl_config_data { long version; /* what version the client wants to use */ long certverifyresult; /* result from the certificate verification */ long verifypeer; /* set TRUE if this is desired */ long verifyhost; /* 0: no verify 1: check that CN exists 2: CN must match hostname */ char *CApath; /* DOES NOT WORK ON WINDOWS */ char *CAfile; /* cerficate to verify peer against */ char *random_file; /* path to file containing "random" data */ char *egdsocket; /* path to file containing the EGD daemon socket */ char *cipher_list; /* list of ciphers to use */ long numsessions; /* SSL session id cache size */ curl_ssl_ctx_callback fsslctx; /* function to initialize ssl ctx */ void *fsslctxp; /*parameter for call back */};/* information stored about one single SSL session */struct curl_ssl_session { char *name; /* host name for which this ID was used */ void *sessionid; /* as returned from the SSL layer */ long age; /* just a number, the higher the more recent */ unsigned short remote_port; /* remote port to connect to */ struct ssl_config_data ssl_config; /* setup for this session */};/* Struct used for Digest challenge-response authentication */struct digestdata { char *nonce; char *cnonce; char *realm; int algo;};typedef enum { NTLMSTATE_NONE, NTLMSTATE_TYPE1, NTLMSTATE_TYPE2, NTLMSTATE_TYPE3, NTLMSTATE_LAST} curlntlm;/* Struct used for Digest challenge-response authentication */struct ntlmdata { curlntlm state; unsigned char nonce[8];};#ifdef HAVE_GSSAPIstruct negotiatedata { bool gss; /* Whether we're processing GSS-Negotiate or Negotiate */ const char* protocol; /* "GSS-Negotiate" or "Negotiate" */ OM_uint32 status; gss_ctx_id_t context; gss_name_t server_name; gss_buffer_desc output_token;};#endif/**************************************************************************** * HTTP unique setup ***************************************************************************/struct HTTP { struct FormData *sendit; int postsize; char *postdata; const char *p_pragma; /* Pragma: string */ const char *p_accept; /* Accept: string */ long readbytecount; long writebytecount; /* For FORM posting */ struct Form form; struct Curl_chunker chunk; struct back { curl_read_callback fread; /* backup storage for fread pointer */ void *fread_in; /* backup storage for fread_in pointer */ char *postdata; int postsize; } backup; enum { HTTPSEND_NADA, /* init */ HTTPSEND_REQUEST, /* sending a request */ HTTPSEND_BODY, /* sending body */ HTTPSEND_LAST /* never use this */ } sending; void *send_buffer; /* used if the request couldn't be sent in one chunk, points to an allocated send_buffer struct */};/**************************************************************************** * FTP unique setup ***************************************************************************/struct FTP { long *bytecountp; char *user; /* user name string */ char *passwd; /* password string */ char *urlpath; /* the originally given path part of the URL */ char *dirs[CURL_MAX_FTP_DIRDEPTH]; /* path components */ char *file; /* decoded file */ char *entrypath; /* the PWD reply when we logged on */ char *cache; /* data cache between getresponse()-calls */ size_t cache_size; /* size of cache in bytes */ bool dont_check; /* Set to TRUE to prevent the final (post-transfer) file size and 226/250 status check. It should still read the line, just ignore the result. */ bool no_transfer; /* nothing was transfered, (possibly because a resumed transfer already was complete) */ long response_time; /* When no timeout is given, this is the amount of seconds we await for an FTP response. Initialized in Curl_ftp_connect() */};/**************************************************************************** * FILE unique setup ***************************************************************************/struct FILE { int fd; /* open file descriptor to read from! */};/* * Boolean values that concerns this connection. */struct ConnectBits { bool close; /* if set, we close the connection after this request */ bool reuse; /* if set, this is a re-used connection */ bool chunk; /* if set, this is a chunked transfer-encoding */ bool httpproxy; /* if set, this transfer is done through a http proxy */ bool user_passwd; /* do we use user+password for this connection? */ bool proxy_user_passwd; /* user+password for the proxy? */ bool ipv6_ip; /* we communicate with a remove site specified with pure IPv6 IP address */ bool use_range; bool rangestringalloc; /* the range string is malloc()'ed */ bool do_more; /* this is set TRUE if the ->curl_do_more() function is supposed to be called, after ->curl_do() */ bool upload_chunky; /* set TRUE if we are doing chunked transfer-encoding on upload */ bool getheader; /* TRUE if header parsing is wanted */ bool forbidchunk; /* used only to explicitly forbid chunk-upload for specific upload buffers. See readmoredata() in http.c for details. */ bool tcpconnect; /* the tcp stream (or simimlar) is connected, this is set the first time on the first connect function call */};/* * This struct is all the previously local variables from Curl_perform() moved
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -