httpd.h revision 439ccf2a084e1da566548931c585cbcc3a9e7f4c
97a9a944b5887e91042b019776c41d5dd74557aferikabele/* Licensed to the Apache Software Foundation (ASF) under one or more
97a9a944b5887e91042b019776c41d5dd74557aferikabele * contributor license agreements. See the NOTICE file distributed with
97a9a944b5887e91042b019776c41d5dd74557aferikabele * this work for additional information regarding copyright ownership.
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * The ASF licenses this file to You under the Apache License, Version 2.0
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * (the "License"); you may not use this file except in compliance with
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * the License. You may obtain a copy of the License at
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Unless required by applicable law or agreed to in writing, software
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * distributed under the License is distributed on an "AS IS" BASIS,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * See the License for the specific language governing permissions and
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * limitations under the License.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @brief HTTP Daemon routines
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE Apache
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * Top level group of which all other groups are a member
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_MODS Apache Modules
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Top level group for Apache Modules
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_OS Operating System Specific
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_CORE Apache Core
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_CORE_DAEMON HTTP Daemon Routine
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* XXX - We need to push more stuff to other .h files, or even .c files, to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * make this file smaller
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Headers in which EVERYONE has an interest... */
117c1f888a14e73cdd821dc6c23eb0411144a41cnd/* Note: apr_uri.h is also included, see below */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndextern "C" {
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* ----------------------------- config dir ------------------------------ */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Define this to be the default server home dir. Most things later in this
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * file with a relative pathname will have this added.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set default for OS/2 file system */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set default for Windows file system */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set the default for BeOS */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Set the default for NetWare */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set for all other OSs */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif /* HTTPD_ROOT */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * --------- You shouldn't have to edit anything below this line ----------
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Any modifications to any defaults not defined above should be done in the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * respective configuration file.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Default location of documents. Can be overridden by the DocumentRoot
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * directive.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* Set default for OS/2 file system */
4c36c711036219c80d5517d35be68a4769c15291slive/* Set default for non OS/2 file system */
4c36c711036219c80d5517d35be68a4769c15291slive#endif /* DOCUMENT_LOCATION */
4c36c711036219c80d5517d35be68a4769c15291slive/** Maximum number of dynamically loaded modules */
4c36c711036219c80d5517d35be68a4769c15291slive/** Default administrator's address */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** The name of the log files */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif /* DEFAULT_ERRORLOG */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Define this to be what your per-directory security files are called */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* Set default for OS/2 file system */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif /* DEFAULT_ACCESS_FNAME */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The name of the server config file */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** The default path for CGI scripts if none is currently set */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The path to the suExec wrapper, can be overridden in Configuration */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The timeout for waiting for messages */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The timeout for waiting for keepalive timeout until next request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The number of requests to entertain per connection */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Limits on the size of various request items. These limits primarily
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * exist to prevent simple denial-of-service attacks on a server based
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * on misuse of the protocol. The recommended values will depend on the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * nature of the server resources -- CGI scripts and database backends
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * might require large values, but most servers could get by with much
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * smaller limits than we use below. The request message body size can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * be limited by the per-dir config directive LimitRequestBody.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * These two limits can be lowered (but not raised) by the server config
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * directives LimitRequestLine and LimitRequestFieldsize, respectively.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the server config directive LimitRequestFields.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on bytes in Request-Line (Method+URI+HTTP-version) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on bytes in any one header field */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on number of request header fields */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The default default character set name to add if AddDefaultCharset is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * enabled. Overridden with AddDefaultCharsetName.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#endif /* CORE_PRIVATE */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** default HTTP Server protocol */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* ------------------ stuff that modules are allowed to look at ----------- */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Define this to be what your HTML directory content files are called */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Define this to be what type you'd like returned for files with unknown
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * suffixes.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @warning MUST be all lower case.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * NO_CONTENT_TYPE is an alternative DefaultType value that suppresses
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * setting any default type when there's no information (e.g. a proxy).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The name of the MIME types file */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Define the HTML doctype strings centrally.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** HTML 2.0 Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 2.0//EN\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 3.2 Doctype */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "DTD HTML 3.2 Final//EN\">\n"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** HTML 4.0 Strict Doctype */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 4.0//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 4.0 Transitional Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "DTD HTML 4.0 Transitional//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 4.0 Frameset Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 4.0 Frameset//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** XHTML 1.0 Strict Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD XHTML 1.0 Strict//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "xhtml1-strict.dtd\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** XHTML 1.0 Transitional Doctype */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \
c6a2d6fa44f8698851dec5051ee3782c2913605fnd "DTD XHTML 1.0 Transitional//EN\"\n" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "xhtml1-transitional.dtd\">\n"
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** XHTML 1.0 Frameset Doctype */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "DTD XHTML 1.0 Frameset//EN\"\n" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "xhtml1-frameset.dtd\">"
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_VERSION(major,minor) (1000*(major)+(minor))
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Major part of HTTP protocol */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Minor part of HTTP protocol */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* -------------- Port number for server running standalone --------------- */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** default HTTP Port */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** default HTTPS Port */
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Check whether @a port is the default port for the request @a r.
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param port The port number
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param r The request
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @see #ap_default_port
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Get the default port for a request (which depends on the scheme).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param r The request
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Get the scheme for a request.
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param r The request
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The default string length */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The length of a Huge string */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The size of the server's internal read-write buffers */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The max number of regex captures that can be expanded by ap_pregsub */
97a9a944b5887e91042b019776c41d5dd74557aferikabele * APR_HAS_LARGE_FILES introduces the problem of spliting sendfile into
97a9a944b5887e91042b019776c41d5dd74557aferikabele * mutiple buckets, no greater than MAX(apr_size_t), and more granular
97a9a944b5887e91042b019776c41d5dd74557aferikabele * than that in case the brigade code/filters attempt to read it directly.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * ### 16mb is an invention, no idea if it is reasonable.
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Special Apache error codes. These are basically used
97a9a944b5887e91042b019776c41d5dd74557aferikabele * in http_main.c so we can keep track of various errors.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** a normal exit */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** A fatal error arising during the server's init sequence */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The child died during its init sequence */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The child exited due to a resource shortage.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The parent should limit the rate of forking until
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the situation is resolved.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A fatal error, resulting in the whole server aborting.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * If a child exits with this error, the parent process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * considers this a server-wide fatal error and aborts.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Stuff marked #AP_DECLARE is part of the API, and intended for use
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * by modules. Its purpose is to allow us to add attributes that
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * particular platforms or compilers require to every exported function.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Stuff marked #AP_DECLARE_NONSTD is part of the API, and intended for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * use by modules. The difference between #AP_DECLARE and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * #AP_DECLARE_NONSTD is that the latter is required for any functions
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * which use varargs or are used via indirect function call. This
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * is to accomodate the two calling conventions in windows dlls.
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * @internal
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * modules should not use functions marked AP_CORE_DECLARE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @internal
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * modules should not use functions marked AP_CORE_DECLARE_NONSTD
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief The numeric version information is broken out into fields within this
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * structure.
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef struct {
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem const char *add_string; /**< additional string like "-dev" */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return httpd's version information in a numeric form.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param version Pointer to a version structure for returning the version
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * information.
eaaa852423e42d6d86bcada80ed781a205fc3e5fndAP_DECLARE(void) ap_get_server_revision(ap_version_t *version);
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * Get the server banner in a form suitable for sending over the
fb82af0f0cd7b58eef19c54b086131b7e1e1e749madhum * network, with the level of information controlled by the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * ServerTokens directive.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The server banner
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * Get the server description in a form suitable for local displays,
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * status reports, or logging. This includes the detailed server
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * version and information about some modules. It is not affected
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * by the ServerTokens directive.
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * @return The server description
9335f6d807d76d60e54af4ededdebebddb3e3d13noodlAP_DECLARE(const char *) ap_get_server_description(void);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Add a component to the server description and banner strings
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param pconf The pool to allocate the component from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param component The string to add
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Get the date a time that the server was built
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return The server build time string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DONE -2 /**< Module has served the response completely
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * - it's safe to die() with no more output
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @defgroup HTTP_Status HTTP Status Codes
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The size of the static array in http_protocol.c for storing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * all of the potential response status-lines (a sparse table).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A future version should dynamically generate the apr_table_t at startup.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code informational */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code OK ?*/
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code a redirect */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a error (client or server) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a client error */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code a server error */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a (potentially) valid response code? */
4e3cdb85620921a8a120fe22edbccae708f4f34end#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
4e3cdb85620921a8a120fe22edbccae708f4f34end/** should the status code drop the connection */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem (((x) == HTTP_BAD_REQUEST) || \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @defgroup Methods List of Methods recognized by the server
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @ingroup APACHE_CORE_DAEMON
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Methods recognized (but not necessarily handled) by the server.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * These constants are used in bit shifting masks of size int, so it is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * unsafe to have more methods than bits in an int. HEAD == M_GET.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * This list must be tracked by the list in http_protocol.c in routine
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * ap_method_name_of().
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_PATCH 7 /** no rfc(!) ### remove this one? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_VERSION_CONTROL 15 /** RFC 3253: WebDAV Versioning */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define M_INVALID 26 /** RFC 3253: WebDAV Versioning */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * METHODS needs to be equal to the number of bits
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * we are using for limit masks.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The method mask bit to shift for anding with a bitmask.
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl/** @see ap_method_list_t */
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * @struct ap_method_list_t
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Structure for handling HTTP methods.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Methods known to the server are accessed via a bitmask shortcut;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * extension methods are handled by an array.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The bitmask used for known methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the array used for extension methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @defgroup module_magic Module Magic mime types
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Magic for mod_cgi[d] */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Magic for mod_include */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** Magic for mod_include */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** Magic for mod_dir */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Just in case your linefeed isn't the one the other end is expecting. */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** linefeed */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** carrige return */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** carrige return /Line Feed Combo */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#else /* APR_CHARSET_EBCDIC */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * in the buff package (bread/bputs/bwrite). Everywhere else, we use
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * "native EBCDIC" CR and NL characters. These are therefore
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * defined as
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * '\r' and '\n'.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif /* APR_CHARSET_EBCDIC */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @defgroup values_request_rec_body Possible values for request_rec.read_body
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Possible values for request_rec.read_body (set by handling module):
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Send 413 error if message has any body */
4c36c711036219c80d5517d35be68a4769c15291slive/** Send 411 error if body without Content-Length */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** If chunked, remove the chunks for me. */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** @} // values_request_rec_body */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup values_request_rec_used_path_info Possible values for request_rec.used_path_info
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @ingroup APACHE_CORE_DAEMON
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Possible values for request_rec.used_path_info:
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Accept the path_info from the request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Return a 404 error if path_info was given */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Module may chose to use the given path_info */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** @} // values_request_rec_used_path_info */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Things which may vary per file-lookup WITHIN a request ---
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * e.g., state of MIME config. Basically, the name of an object, info
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * about the object, and any other info we may ahve which may need to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * change as we go poking around looking for it (e.g., overridden by
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * .htaccess files).
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Note how the default state of almost all these things is properly
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * zero, so that allocating it with pcalloc does the right thing without
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * a whole lot of hairy initialization... so long as we are willing to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * make the (fairly) portable assumption that the bit pattern of a NULL
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * pointer is, in fact, zero.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief This represents the result of calling htaccess; these are cached for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * each request.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the directory to which this applies */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *dir;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the overrides allowed for the .htaccess file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the override options allowed for the .htaccess file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the configuration directives */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** the next one, or NULL if no more; N.B. never change this */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* The following four types define a hierarchy of activities, so that
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * given a request_rec r you can write r->connection->server->process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * to get to the process_rec. While this reduces substantially the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * number of arguments that various hooks require beware that in
97a9a944b5887e91042b019776c41d5dd74557aferikabele * threaded versions of the server you must consider multiplexing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * issues. */
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** A structure that represents one process */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents a virtual server */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents one connection */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents the current request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents the status of the current connection */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* ### would be nice to not include this from httpd.h ... */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* This comes after we have defined the request_rec type */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief A structure that represents one process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Global pool. Cleared upon normal exit */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Configuration pool. Cleared upon restart */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Number of command line arguments passed to the program */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The command line arguments */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char * const *argv;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The program name used to execute the program */
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @brief A structure that represents the current request
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The pool associated with the request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The connection to the client */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The virtual host for this request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the redirected request if this is an external redirect */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the previous request if this is an internal redirect */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the main request if this is a sub-request
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Info about the request itself... we begin with stuff that only
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * protocol.c should ever touch...
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** First line of request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** HTTP/0.9, "simple" request (e.g. GET /foo\n w/no headers) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A proxy request (calculated during post_read_request/translate_name)
97a9a944b5887e91042b019776c41d5dd74557aferikabele * possible values PROXYREQ_NONE, PROXYREQ_PROXY, PROXYREQ_REVERSE,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * PROXYREQ_RESPONSE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** HEAD request, as opposed to GET */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Protocol string, as given to us, or HTTP/0.9 */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Protocol version number of protocol; 1.1 = 1001 */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Host, as set by full URI or Host: */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *hostname;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Time when the request started */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Status line, if set by script */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Status line */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen * look, but don't touch.
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Request method (eg. GET, HEAD, POST, etc.) */
8ac3ff7008df949c096f9cd8f769c7893594f61fnd const char *method;
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** M_GET, M_POST, etc. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * 'allowed' is a bitvector of the allowed methods.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A handler must ensure that the request method is one that
97a9a944b5887e91042b019776c41d5dd74557aferikabele * it is capable of handling. Generally modules should DECLINE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * any request methods they do not handle. Prior to aborting the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * handler like this the handler should set r->allowed to the list
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * of methods that it is willing to handle. This bitvector is used
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * to construct the "Allow:" header required for OPTIONS requests,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * and HTTP_METHOD_NOT_ALLOWED and HTTP_NOT_IMPLEMENTED status codes.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Since the default_handler deals with OPTIONS, all modules can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * usually decline to deal with OPTIONS. TRACE is always allowed,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * modules don't need to set it explicitly.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Since the default_handler will always handle a GET, a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * module which does *not* implement GET should probably return
97a9a944b5887e91042b019776c41d5dd74557aferikabele * HTTP_METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * handler can't be installed by mod_actions.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Array of extension methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** List of allowed methods */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** byte count in stream is for body */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** body byte count, for easy access */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Last modified time of the requested resource */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* HTTP/1.1 connection-level features */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** sending chunked transfer-coding */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The Range: header */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *range;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The "real" content length */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Remaining bytes left to read from the request body */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** Number of bytes that have been read from the request body */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** Method for reading the request body
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * (eg. REQUEST_CHUNKED_ERROR, REQUEST_NO_BODY,
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * REQUEST_CHUNKED_DECHUNK, etc...) */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** reading chunked transfer-coding */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** is client waiting for a 100 response? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* MIME header environments, in and out. Also, an array containing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * environment variables to be passed to subprocesses, so people can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * write modules to add to that environment.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The difference between headers_out and err_headers_out is that the
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * latter are printed even on error, and persist across internal redirects
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * (so the headers printed for ErrorDocument handlers will have them).
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * The 'notes' apr_table_t is for notes from one module to another, with no
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * other set purpose in mind...
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** MIME header environment from the request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** MIME header environment for the response */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** MIME header environment for the response, printed even on errors and
1578daeec017d3bb20cecdcdc3b0261c999730d5slive * persist across internal redirects */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** Array of environment variables to be used for sub processes */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** Notes from one module to another */
ab6f5669a4cb16dbff7d791d434ba1b9c9b50928nd /* content_type, handler, content_encoding, and all content_languages
9f7f8f89dfb9115b0b9493049a6ca1ecd8508242rbowen * MUST be lowercased strings. They may be pointers to static strings;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * they should not be modified in place.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The content-type for the current request */
97a9a944b5887e91042b019776c41d5dd74557aferikabele const char *content_type; /* Break these out --- we dispatch on 'em */
9f7f8f89dfb9115b0b9493049a6ca1ecd8508242rbowen /** The handler string that we use to call a handler function */
97a9a944b5887e91042b019776c41d5dd74557aferikabele const char *handler; /* What we *really* dispatch on */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** How to encode the data */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Array of strings representing the content languages */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** variant list validator (if negotiated) */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** If an authentication check was made, this gets set to the user name. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** If an authentication check was made, this gets set to the auth type. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** This response can not be cached */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** There is no local copy of this response */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /* What object is being requested (either directly, or via include
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * or content-negotiation mapping).
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** The URI without any parsing performed */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The path portion of the URI */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The filename on disk corresponding to this response */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /* XXX: What does this mean? Please define "canonicalize" -aaron */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The true filename, we canonicalize r->filename if these don't match */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The PATH_INFO extracted from this request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** The QUERY_ARGS extracted from this request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** finfo.protection (st_mode) set to zero if no such file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A struct containing the components of URI */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Flag for the handler to accept or reject path_info on
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the current request. All modules should respect the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * AP_REQ_ACCEPT_PATH_INFO and AP_REQ_REJECT_PATH_INFO
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * values, while AP_REQ_DEFAULT_PATH_INFO indicates they
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * may follow existing conventions. This is set to the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * user's preference upon HOOK_VERY_FIRST of the fixups.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Various other config info which may change with .htaccess files
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * These are config vectors, with one void* pointer for each module
97a9a944b5887e91042b019776c41d5dd74557aferikabele * (the thing pointed to being the module's business).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Options set in config files, etc. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Notes on *this* request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A linked list of the .htaccess configuration directives
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * accessed by this request.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * N.B. always add to the head of the list, _never_ to the end.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * that way, a sub request's list can (temporarily) point to a parent's list
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of output filters to be used for this request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of input filters to be used for this request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of protocol level output filters to be used for this
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A list of protocol level input filters to be used for this
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * request */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd /** A flag to determine if the eos bucket has been sent yet */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd /** The optional kept body of the request. */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd/* Things placed at the end of the record to avoid breaking binary
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * compatibility. It would be nice to remember to reorder the entire
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * record to improve 64bit alignment the next time we need to break
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * binary compatibility for some other reason.
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * @defgroup ProxyReq Proxy request types
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * Possible values of request_rec->proxyreq. A request could be normal,
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * proxied or reverse proxied. Normally proxied and reverse proxied are
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * grouped together as just "proxied", but sometimes it's necessary to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * tell the difference between the two, such as for authentication.
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define PROXYREQ_RESPONSE 3 /**< Origin response */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Enumeration of connection keepalive options
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef enum {
0203b896e484dfb877111aceffb812401d0f216and * @brief Structure to store things which are per connection
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pool associated with this connection */
844def494f17cb1ab0983427d5c3939e1a03ff8cnd /** Physical vhost this conn came in on */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** used by http_vhost.c */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Information about the connection itself */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** local address */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** remote address */
0203b896e484dfb877111aceffb812401d0f216and /** Client's IP address */
0203b896e484dfb877111aceffb812401d0f216and /** Client's DNS name, if known. NULL if DNS hasn't been checked,
0203b896e484dfb877111aceffb812401d0f216and * "" if it has and no address was found. N.B. Only access this though
0203b896e484dfb877111aceffb812401d0f216and * get_remote_host() */
0203b896e484dfb877111aceffb812401d0f216and /** Only ever set if doing rfc1413 lookups. N.B. Only access this through
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * get_remote_logname() */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Are we still talking? */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Are we going to keep the connection alive for another request?
96147932f199be4ad038778e702c13a2f79051c0slive * @see ap_conn_keepalive_e */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** How many times have we used it? */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** server IP address */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** used for ap_get_server_name when UseCanonicalName is set to DNS
630c456b6461158be6cc5c5483735e27b13b4ad5nd * (ignores setting of HostnameLookups) */
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl /** ID of this connection; unique at any point in time */
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl /** Config vector containing pointers to connections per-server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * config structures. */
96147932f199be4ad038778e702c13a2f79051c0slive /** Notes on *this* connection: send note from one module to
96147932f199be4ad038778e702c13a2f79051c0slive * another. must remain valid for all requests on this conn */
96147932f199be4ad038778e702c13a2f79051c0slive /** A list of input filters to be used for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive /** A list of output filters to be used for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive /** handle to scoreboard information for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive /** The bucket allocator to use for all bucket/brigade creations */
d1348237b33bc1755b9f1165eea52317465a7671nd /** The current state of this connection */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Is there data pending in the input filters? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Is there data pending in the output filters? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Are there any filters that clogg/buffer the input stream, breaking
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the event mpm.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Enumeration of connection states
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemtypedef enum {
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief A structure to contain connection state information
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** APR_RING of expiration timeouts */
96147932f199be4ad038778e702c13a2f79051c0slive /** the expiration time of the next keepalive timeout */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Current state of the connection */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** connection record this struct refers to */
edc8d9e0cce625a77afd1ff87a8f955694a973e2rbowen /** memory pool to allocate from */
edc8d9e0cce625a77afd1ff87a8f955694a973e2rbowen /** bucket allocator */
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** poll file decriptor information */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Per-vhost config... */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The address 255.255.255.255, when used as a virtualhost address,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * will become the "default" server when the ip doesn't match other vhosts.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @struct server_addr_rec
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief A structure to be used for Per-vhost config
96147932f199be4ad038778e702c13a2f79051c0slive /** The next server in the list */
96147932f199be4ad038778e702c13a2f79051c0slive /** The bound address, for this server */
96147932f199be4ad038778e702c13a2f79051c0slive /** The bound port, for this server */
96147932f199be4ad038778e702c13a2f79051c0slive /** The name given in "<VirtualHost>" */
96147932f199be4ad038778e702c13a2f79051c0slive * @brief A structure to store information for each virtual server
96147932f199be4ad038778e702c13a2f79051c0slive /** The process this server is running in */
96147932f199be4ad038778e702c13a2f79051c0slive /** The next server in the list */
96147932f199be4ad038778e702c13a2f79051c0slive /** The name of the server */
96147932f199be4ad038778e702c13a2f79051c0slive const char *defn_name;
96147932f199be4ad038778e702c13a2f79051c0slive /** The line of the config file that the server was defined on */
96147932f199be4ad038778e702c13a2f79051c0slive /* Contact information */
96147932f199be4ad038778e702c13a2f79051c0slive /** The admin's contact information */
96147932f199be4ad038778e702c13a2f79051c0slive /** The server hostname */
96147932f199be4ad038778e702c13a2f79051c0slive /** for redirects, etc. */
96147932f199be4ad038778e702c13a2f79051c0slive /* Log files --- note that transfer log is now in the modules... */
96147932f199be4ad038778e702c13a2f79051c0slive /** The name of the error log */
96147932f199be4ad038778e702c13a2f79051c0slive /** A file descriptor that references the error log */
96147932f199be4ad038778e702c13a2f79051c0slive /** The log level for this server */
96147932f199be4ad038778e702c13a2f79051c0slive /* Module-specific configuration for server, and defaults... */
96147932f199be4ad038778e702c13a2f79051c0slive /** true if this is the virtual server */
96147932f199be4ad038778e702c13a2f79051c0slive /** Config vector containing pointers to modules' per-server config
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * structures. */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** MIME type info, etc., before we start checking per-directory info */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /* Transaction handling */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** I haven't got a clue */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Timeout, as an apr interval, before we give up */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The apr interval we will wait for another request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Maximum requests per connection */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Use persistent connections? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Pathname for ServerPath */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *path;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Length of path */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Normal names for ServerAlias servers */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Wildcarded names for ServerAlias servers */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on size of the HTTP request line */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on size of any request header field */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on number of request header fields */
96147932f199be4ad038778e702c13a2f79051c0slive /** The server request scheme for redirect responses */
96147932f199be4ad038778e702c13a2f79051c0slivetypedef struct core_output_filter_ctx {
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef struct core_filter_ctx {
96147932f199be4ad038778e702c13a2f79051c0slivetypedef struct core_net_rec {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Connection to the client */
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl /** connection record */
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * Examine a field value (such as a media-/content-type) string and return
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @param p Pool to allocate memory from
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @param intype The field to examine
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @return A copy of the field minus any parameters
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Convert a time from an integer into a string in a specified format
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param t The time to convert
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param fmt The format to use for the conversion
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param gmt Convert the time for GMT?
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The string that represents the specified time
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/* String handling. The *_nc variants allow you to use non-const char **s as
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl arguments (unfortunately C won't automatically convert a char ** to a const
8a571abb6573d916da05fc8b9f04fd944ad45803slive char **) */
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get the characters until the first occurance of a specified character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param line The string to get the characters from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param stop The character to stop at
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the characters up to the first stop character
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get the characters until the first occurance of a specified character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The string to get the characters from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param stop The character to stop at
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return A copy of the characters up to the first stop character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @note This is the same as ap_getword(), except it doesn't use const char **.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Get the first word from a given string. A word is defined as all characters
8a571abb6573d916da05fc8b9f04fd944ad45803slive * up to the first whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The string to traverse
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The first word in the line
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Get the first word from a given string. A word is defined as all characters
8a571abb6573d916da05fc8b9f04fd944ad45803slive * up to the first whitespace.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The string to traverse
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The first word in the line
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note The same as ap_getword_white(), except it doesn't use const char**
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get all characters from the first occurance of @a stop to the first "\0"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The line to traverse
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param stop The character to start at
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return A copy of all caracters after the first occurance of the specified
8a571abb6573d916da05fc8b9f04fd944ad45803slive * character
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
8ed0917f332087770872e032b248b2e1e689df3bslive * Get all characters from the first occurance of @a stop to the first "\0"
8ed0917f332087770872e032b248b2e1e689df3bslive * @param p The pool to allocate memory from
8ed0917f332087770872e032b248b2e1e689df3bslive * @param line The line to traverse
8ed0917f332087770872e032b248b2e1e689df3bslive * @param stop The character to start at
8ed0917f332087770872e032b248b2e1e689df3bslive * @return A copy of all caracters after the first occurance of the specified
8ed0917f332087770872e032b248b2e1e689df3bslive * character
8ed0917f332087770872e032b248b2e1e689df3bslive * @note The same as ap_getword_nulls(), except it doesn't use const char **.
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Get the second word in the string paying attention to quoting
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The line to traverse
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Get the second word in the string paying attention to quoting
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param line The line to traverse
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return A copy of the string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @note The same as ap_getword_conf(), except it doesn't use const char **.
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Check a string for any ${ENV} environment variable construct and replace
8a571abb6573d916da05fc8b9f04fd944ad45803slive * each them by the value of that environment variable, if it exists. If the
8a571abb6573d916da05fc8b9f04fd944ad45803slive * environment value does not exist, leave the ${ENV} construct alone; it
8a571abb6573d916da05fc8b9f04fd944ad45803slive * means something else.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param word The string to check
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return The string with the replaced environment variables
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Size an HTTP header field list item, as separated by a comma.
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param field The field to size
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param len The length of the field
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return The return value is a pointer to the beginning of the non-empty
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * list item within the original string (or NULL if there is none) and the
8a571abb6573d916da05fc8b9f04fd944ad45803slive * address of field is shifted to the next non-comma, non-whitespace
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * character. len is the length of the item excluding any beginning whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Retrieve an HTTP header field list item, as separated by a comma,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * while stripping insignificant whitespace and lowercasing anything not in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * a quoted string or comment.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param field The field to retrieve
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The return value is a new string containing the converted list
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * item (or NULL if none) and the address pointed to by field is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * shifted to the next non-comma, non-whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Find an item in canonical form (lowercase, no extra spaces) within
8a571abb6573d916da05fc8b9f04fd944ad45803slive * an HTTP field value list.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The field value list to search
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param tok The token to search for
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return 1 if found, 0 if not found.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Retrieve a token, spacing over it and adjusting the pointer to
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * the first non-white byte afterwards. Note that these tokens
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * are delimited by semis and commas and can also be delimited
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * by whitespace at the caller's option.
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param p The pool to allocate from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param accept_line The line to retrieve the token from (adjusted afterwards)
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param accept_white Is it delimited by whitespace
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return the token
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Find http tokens, see the definition of token from RFC2068
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param line The line to find the token
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param tok The token to find
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return 1 if the token is found, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * find http tokens from the end of the line
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The line to find the token
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param tok The token to find
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 1 if the token is found, 0 otherwise
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Check for an Absolute URI syntax
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param u The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if URI, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Unescape a URL
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param url The url to unescape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 0 on success, non-zero otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Unescape a URL, but leaving %2f (slashes) escaped
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param url The url to unescape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 0 on success, non-zero otherwise
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Convert all double slashes to single slashes
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param name The string to convert
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Remove all ./ and xx/../ substrings from a file name. Also remove
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * any leading ../ or /../ substrings.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param name the file name to parse
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Escape a path segment, as defined in RFC 1808
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param p The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param s The path to convert
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The converted URL
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * convert an OS path to a URL in an OS dependant way.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param path The path to convert
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param partial if set, assume that the path will be appended to something
8a571abb6573d916da05fc8b9f04fd944ad45803slive * with a '/' in it (and thus does not prefix "./")
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The converted URL
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
8a571abb6573d916da05fc8b9f04fd944ad45803slive/** @see ap_os_escape_path */
8a571abb6573d916da05fc8b9f04fd944ad45803slive#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * Escape an html string
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * @param p The pool to allocate from
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * @param s The html to escape
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The escaped string
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Escape a string for logging
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to escape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The escaped string
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Escape a string for logging into the error log (without a pool)
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param dest The buffer to write to
20189240503ef2c8f5dc6e2248b57faab4b23b5and * @param source The string to escape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param buflen The buffer size for the escaped string (including "\0")
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The len of the escaped string (always < maxlen)
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Construct a full hostname
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param hostname The hostname of the server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param port The port the server is running on
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param r The current request
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The server's hostname
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwroweAP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Escape a shell command
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param p The pool to allocate from
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param s The command to escape
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The escaped shell command
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Count the number of directories in a path
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param path The path to count
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The number of directories
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Copy at most @a n leading directories of @a s into @a d. @a d
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * should be at least as large as @a s plus 1 extra byte
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param d The location to copy to
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param s The location to copy from
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param n The number of directories to copy
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return value is the ever useful pointer to the trailing "\0" of d
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @note on platforms with drive letters, n = 0 returns the "/" root,
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * whereas n = 1 returns the "d:/" root. On all other platforms, n = 0
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * returns the empty string. */
97a9a944b5887e91042b019776c41d5dd74557aferikabeleAP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return the parent directory name (including trailing /) of the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param s The file to get the parent of
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the file's parent directory
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Given a directory and filename, create a single path from them. This
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * function is smart enough to ensure that there is a sinlge '/' between the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * directory and file names
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param a The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param dir The directory name
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param f The filename
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return A copy of the full path
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note Never consider using this function if you are dealing with filesystem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * names that need to remain canonical, unless you are merging an apr_dir_read
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * path and returned filename. Otherwise, the result is not canonical.
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Test if the given path has an an absolute path.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param dir The directory name
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note The converse is not necessarily true, some OS's (Win32/OS2/Netware) have
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * multiple forms of absolute paths. This only reports if the path is absolute
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * in a canonical sense.
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Does the provided string contain wildcard characters? This is useful
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * for determining if the string should be passed to strcmp_match or to strcmp.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The only wildcard characters recognized are '?' and '*'
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if the string has wildcards, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Determine if a string matches a patterm containing the wildcards '?' or '*'
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param str The string to check
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param expected The pattern to match against
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @return 1 if the two strings match, 0 otherwise
97a9a944b5887e91042b019776c41d5dd74557aferikabeleAP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected);
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Determine if a string matches a patterm containing the wildcards '?' or '*',
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * ignoring case
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param expected The pattern to match against
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if the two strings match, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Find the first occurrence of the substring s2 in s1, regardless of case
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param s1 The string to search
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param s2 The substring to search for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A pointer to the beginning of the substring
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @remark See apr_strmatch() for a faster alternative
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return a pointer to the location inside of bigstring immediately after prefix
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param bigstring The input string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param prefix The prefix to strip away
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A pointer relative to bigstring after prefix
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *prefix);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Decode a base64 encoded string into memory allocated from a pool
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param bufcoded The encoded string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return The decoded string
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Encode a string into memory allocated from a pool in base 64 format
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @param p The pool to allocate from
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * @param string The plaintext string
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @return The encoded string
50337bc37d6a337217f0295bc57aaac558517c11jimAP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string);
int cflags);
* a macro, to avoid unistd.h dependency
const char *delim);
* Given the name of an object in the file system determine if it is a directory - this version is symlink aware
#ifdef _OSD_POSIX
#ifdef AP_DEBUG
#ifdef DEBUG_SIGSTOP
extern int raise_sigstop_flags;
#define RAISE_SIGSTOP(x) do { \
#define RAISE_SIGSTOP(x)
#ifdef strtoul
Note that on some platforms (e.g., AIX with gcc, Solaris with gcc), string.h needs
#include <string.h>
#ifdef AP_DEBUG
#ifdef __cplusplus