📄 httpd.h
字号:
*/ int used_path_info; /* Various other config info which may change with .htaccess files * These are config vectors, with one void* pointer for each module * (the thing pointed to being the module's business). */ /** Options set in config files, etc. */ struct ap_conf_vector_t *per_dir_config; /** Notes on *this* request */ struct ap_conf_vector_t *request_config; /** * A linked list of the .htaccess configuration directives * accessed by this request. * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list */ const struct htaccess_result *htaccess; /** A list of output filters to be used for this request */ struct ap_filter_t *output_filters; /** A list of input filters to be used for this request */ struct ap_filter_t *input_filters; /** A list of protocol level output filters to be used for this * request */ struct ap_filter_t *proto_output_filters; /** A list of protocol level input filters to be used for this * request */ struct ap_filter_t *proto_input_filters; /** A flag to determine if the eos bucket has been sent yet */ int eos_sent;/* Things placed at the end of the record to avoid breaking binary * compatibility. It would be nice to remember to reorder the entire * record to improve 64bit alignment the next time we need to break * binary compatibility for some other reason. */};/** * @defgroup ProxyReq Proxy request types * * Possible values of request_rec->proxyreq. A request could be normal, * proxied or reverse proxied. Normally proxied and reverse proxied are * grouped together as just "proxied", but sometimes it's necessary to * tell the difference between the two, such as for authentication. * @{ */#define PROXYREQ_NONE 0 /**< No proxy */#define PROXYREQ_PROXY 1 /**< Standard proxy */#define PROXYREQ_REVERSE 2 /**< Reverse proxy */#define PROXYREQ_RESPONSE 3 /**< Origin response *//* @} */typedef enum { AP_CONN_UNKNOWN, AP_CONN_CLOSE, AP_CONN_KEEPALIVE} ap_conn_keepalive_e;/** Structure to store things which are per connection */struct conn_rec { /** Pool associated with this connection */ apr_pool_t *pool; /** Physical vhost this conn came in on */ server_rec *base_server; /** used by http_vhost.c */ void *vhost_lookup_data; /* Information about the connection itself */ /** local address */ apr_sockaddr_t *local_addr; /** remote address */ apr_sockaddr_t *remote_addr; /** Client's IP address */ char *remote_ip; /** Client's DNS name, if known. NULL if DNS hasn't been checked, * "" if it has and no address was found. N.B. Only access this though * get_remote_host() */ char *remote_host; /** Only ever set if doing rfc1413 lookups. N.B. Only access this through * get_remote_logname() */ char *remote_logname; /** Are we still talking? */ unsigned aborted:1; /** Are we going to keep the connection alive for another request? * @see ap_conn_keepalive_e */ ap_conn_keepalive_e keepalive; /** have we done double-reverse DNS? -1 yes/failure, 0 not yet, * 1 yes/success */ signed int double_reverse:2; /** How many times have we used it? */ int keepalives; /** server IP address */ char *local_ip; /** used for ap_get_server_name when UseCanonicalName is set to DNS * (ignores setting of HostnameLookups) */ char *local_host; /** ID of this connection; unique at any point in time */ long id; /** Config vector containing pointers to connections per-server * config structures. */ struct ap_conf_vector_t *conn_config; /** Notes on *this* connection: send note from one module to * another. must remain valid for all requests on this conn */ apr_table_t *notes; /** A list of input filters to be used for this connection */ struct ap_filter_t *input_filters; /** A list of output filters to be used for this connection */ struct ap_filter_t *output_filters; /** handle to scoreboard information for this connection */ void *sbh; /** The bucket allocator to use for all bucket/brigade creations */ struct apr_bucket_alloc_t *bucket_alloc;};/* Per-vhost config... *//** * The address 255.255.255.255, when used as a virtualhost address, * will become the "default" server when the ip doesn't match other vhosts. */#define DEFAULT_VHOST_ADDR 0xfffffffful/** A structure to be used for Per-vhost config */typedef struct server_addr_rec server_addr_rec;struct server_addr_rec { /** The next server in the list */ server_addr_rec *next; /** The bound address, for this server */ apr_sockaddr_t *host_addr; /** The bound port, for this server */ apr_port_t host_port; /** The name given in <VirtualHost> */ char *virthost;};/** A structure to store information for each virtual server */struct server_rec { /** The process this server is running in */ process_rec *process; /** The next server in the list */ server_rec *next; /** The name of the server */ const char *defn_name; /** The line of the config file that the server was defined on */ unsigned defn_line_number; /* Contact information */ /** The admin's contact information */ char *server_admin; /** The server hostname */ char *server_hostname; /** for redirects, etc. */ apr_port_t port; /* Log files --- note that transfer log is now in the modules... */ /** The name of the error log */ char *error_fname; /** A file descriptor that references the error log */ apr_file_t *error_log; /** The log level for this server */ int loglevel; /* Module-specific configuration for server, and defaults... */ /** true if this is the virtual server */ int is_virtual; /** Config vector containing pointers to modules' per-server config * structures. */ struct ap_conf_vector_t *module_config; /** MIME type info, etc., before we start checking per-directory info */ struct ap_conf_vector_t *lookup_defaults; /* Transaction handling */ /** I haven't got a clue */ server_addr_rec *addrs; /** Timeout, as an apr interval, before we give up */ apr_interval_time_t timeout; /** The apr interval we will wait for another request */ apr_interval_time_t keep_alive_timeout; /** Maximum requests per connection */ int keep_alive_max; /** Use persistent connections? */ int keep_alive; /** Pathname for ServerPath */ const char *path; /** Length of path */ int pathlen; /** Normal names for ServerAlias servers */ apr_array_header_t *names; /** Wildcarded names for ServerAlias servers */ apr_array_header_t *wild_names; /** limit on size of the HTTP request line */ int limit_req_line; /** limit on size of any request header field */ int limit_req_fieldsize; /** limit on number of request header fields */ int limit_req_fields; };typedef struct core_output_filter_ctx { apr_bucket_brigade *b; apr_pool_t *deferred_write_pool; /* subpool of c->pool used for resources * which may outlive the request */} core_output_filter_ctx_t; typedef struct core_filter_ctx { apr_bucket_brigade *b;} core_ctx_t; typedef struct core_net_rec { /** Connection to the client */ apr_socket_t *client_socket; /** connection record */ conn_rec *c; core_output_filter_ctx_t *out_ctx; core_ctx_t *in_ctx;} core_net_rec;/** * Examine a field value (such as a media-/content-type) string and return * it sans any parameters; e.g., strip off any ';charset=foo' and the like. * @param p Pool to allocate memory from * @param intype The field to examine * @return A copy of the field minus any parameters */AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);/** * Convert a time from an integer into a string in a specified format * @param p The pool to allocate memory from * @param t The time to convert * @param fmt The format to use for the conversion * @param gmt Convert the time for GMT? * @return The string that represents the specified time */AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);/* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const char **) *//** * Get the characters until the first occurance of a specified character * @param p The pool to allocate memory from * @param line The string to get the characters from * @param stop The character to stop at * @return A copy of the characters up to the first stop character */AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);/** * Get the characters until the first occurance of a specified character * @param p The pool to allocate memory from * @param line The string to get the characters from * @param stop The character to stop at * @return A copy of the characters up to the first stop character * @note This is the same as ap_getword(), except it doesn't use const char **. */AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);/** * Get the first word from a given string. A word is defined as all characters * up to the first whitespace. * @param p The pool to allocate memory from * @param line The string to traverse * @return The first word in the line */AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);/** * Get the first word from a given string. A word is defined as all characters * up to the first whitespace. * @param p The pool to allocate memory from * @param line The string to traverse * @return The first word in the line * @note The same as ap_getword_white(), except it doesn't use const char **. */AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);/** * Get all characters from the first occurance of @a stop to the first '\0' * @param p The pool to allocate memory from * @param line The line to traverse * @param stop The character to start at * @return A copy of all caracters after the first occurance of the specified * character */AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line, char stop);/** * Get all characters from the first occurance of @a stop to the first '\0' * @param p The pool to allocate memory from * @param line The line to traverse * @param stop The character to start at * @return A copy of all caracters after the first occurance of the specified * character * @note The same as ap_getword_nulls(), except it doesn't use const char **. */AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);/** * Get the second word in the string paying attention to quoting * @param p The pool to allocate from * @param line The line to traverse * @return A copy of the string */AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);/** * Get the second word in the string paying attention to quoting * @param p The pool to allocate from * @param line The line to traverse * @return A copy of the string * @note The same as ap_getword_conf(), except it doesn't use const char **. */AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);/** * Check a string for any ${ENV} environment variable construct and replace * each them by the value of that environment variable, if it exists. If the * environment value does not exist, leave the ${ENV} construct alone; it * means something else. * @param p The pool to allocate from * @param word The string to check * @return The string with the replaced environment variables */AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word); /** * Size an HTTP header field list item, as separated by a comma. * @param field The field to size * @param len The length of the field * @return The return value is a pointer to the beginning of the non-empty * list item within the original string (or NULL if there is none) and the * address of field is shifted to the next non-comma, non-whitespace * character. len is the length of the item excluding any beginning whitespace. */AP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);/** * Retrieve an HTTP header field list item, as separated by a comma, * while stripping insignificant whitespace and lowercasing anything not in * a quoted string or comment. * @param p The pool to allocate from * @param field The field to retrieve * @return The return value is a new string containing the converted list * item (or NULL if none) and the address pointed to by field is * shifted to the next non-comma, non-whitespace. */AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);/** * Find an item in canonical form (lowercase, no extra spaces) within * an HTTP field value list. * @param p The pool to allocate from * @param line The field value list to search * @param tok The token to search for * @return 1 if found, 0 if not found. */AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);/** * Retrieve a token, spacing over it and returning a pointer to * the first non-white byte afterwards. Note that these tokens * are delimited by semis and commas and can also be delimited * by whitespace at the caller's option. * @param p The pool to allocate from * @param accept_line The line to retrieve the token from * @param accept_white Is it delimited by whitespace * @return the first non-white byte after the token */AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);/** * Find http tokens, see the definition of token from RFC2068 * @param p The pool to allocate from * @param line The line to find the token * @param tok The token to find * @return 1 if the token is found, 0 otherwise */AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);/** * find http tokens from the end of the line * @param p The pool to allocate from * @param line The line to find the token * @param tok The token to find * @return 1 if the token is found, 0 otherwise */AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);/** * Check for an Absolute URI syntax * @param u The string to check * @return 1 if URI, 0 otherwise */AP_DECLARE(int) ap_is_url(const char *u);/** * Unescape a URL * @param url The url to unescape * @return 0 on success, non-zero otherwise */AP_DECLARE(int) ap_unescape_url(char *url);/** * Unescape a URL, but leaving %2f (slashes) escaped * @param url The url to unescape * @return 0 on success, non-zero otherwise */AP_DECLARE(int) ap_unescape_url_keep2f(char *url);/** * Convert all double slashes to single slashes * @param name The string to convert */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -