httpd.h revision 79c0ed7d839527abd86794a6b1d2df4fd189a2a8
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* ====================================================================
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * The Apache Software License, Version 1.1
0a05fab9aadd37834734ffe106fc8ad4488fb3e3rbowen * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * reserved.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Redistribution and use in source and binary forms, with or without
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * modification, are permitted provided that the following conditions
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * 1. Redistributions of source code must retain the above copyright
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * notice, this list of conditions and the following disclaimer.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * 2. Redistributions in binary form must reproduce the above copyright
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * notice, this list of conditions and the following disclaimer in
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * the documentation and/or other materials provided with the
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * distribution.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * 3. The end-user documentation included with the redistribution,
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * if any, must include the following acknowledgment:
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * "This product includes software developed by the
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Apache Software Foundation (http://www.apache.org/)."
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Alternately, this acknowledgment may appear in the software itself,
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * if and wherever such third-party acknowledgments normally appear.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * 4. The names "Apache" and "Apache Software Foundation" must
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * not be used to endorse or promote products derived from this
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * software without prior written permission. For written
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * permission, please contact apache@apache.org.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * 5. Products derived from this software may not be called "Apache",
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * nor may "Apache" appear in their name, without prior written
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * permission of the Apache Software Foundation.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * SUCH DAMAGE.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * ====================================================================
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * This software consists of voluntary contributions made by many
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * individuals on behalf of the Apache Software Foundation. For more
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * information on the Apache Software Foundation, please see
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Portions of this software are based upon public domain software
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * originally written at the National Center for Supercomputing Applications,
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * University of Illinois, Urbana-Champaign.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * @brief HTTP Daemon routines
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* XXX - We need to push more stuff to other .h files, or even .c files, to
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * make this file smaller
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* Headers in which EVERYONE has an interest... */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* Note: util_uri.h is also included, see below */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgunextern "C" {
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* ----------------------------- config dir ------------------------------ */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* Define this to be the default server home dir. Most things later in this
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * file with a relative pathname will have this added.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set default for OS/2 file system */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set default for Windows file system */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set the default for BeOS */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set the default for NetWare */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* HTTPD_ROOT */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * --------- You shouldn't have to edit anything below this line ----------
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Any modifications to any defaults not defined above should be done in the
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * respective configuration file.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Default location of documents. Can be overridden by the DocumentRoot
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * directive.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set default for OS/2 file system */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* DOCUMENT_LOCATION */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Maximum number of dynamically loaded modules */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Default administrator's address */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* The name of the log files */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* DEFAULT_ERRORLOG */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Define this to be what your per-directory security files are called */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Set default for OS/2 file system */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* DEFAULT_ACCESS_FNAME */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* The name of the server config file */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* Whether we should enable rfc1413 identity checking */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* The default path for CGI scripts if none is currently set */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* The path to the suExec wrapper, can be overridden in Configuration */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* The timeout for waiting for messages */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* The timeout for waiting for keepalive timeout until next request */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* The number of requests to entertain per connection */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/* Limits on the size of various request items. These limits primarily
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * exist to prevent simple denial-of-service attacks on a server based
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * on misuse of the protocol. The recommended values will depend on the
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * nature of the server resources -- CGI scripts and database backends
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * might require large values, but most servers could get by with much
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * smaller limits than we use below. The request message body size can
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * be limited by the per-dir config directive LimitRequestBody.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * These two limits can be lowered (but not raised) by the server config
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * directives LimitRequestLine and LimitRequestFieldsize, respectively.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * the server config directive LimitRequestFields.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* default limit on bytes in any one header field */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#endif /* default limit on number of request header fields */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * The default default character set name to add if AddDefaultCharset is
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * enabled. Overridden with AddDefaultCharsetName.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun#endif /* CORE_PRIVATE */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/** default HTTP Server protocol */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* ------------------ stuff that modules are allowed to look at ----------- */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** Define this to be what your HTML directory content files are called */
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * Define this to be what type you'd like returned for files with unknown
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * suffixes.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun * @warning MUST be all lower case.
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun/** The name of the MIME types file */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi * Define the HTML doctype strings centrally.
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** HTML 2.0 Doctype */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi "DTD HTML 2.0//EN\">\n"
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** HTML 3.2 Doctype */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi "DTD HTML 3.2 Final//EN\">\n"
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** HTML 4.0 Strict Doctype */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi "DTD HTML 4.0//EN\"\n" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** HTML 4.0 Transitional Doctype */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi "DTD HTML 4.0 Transitional//EN\"\n" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** HTML 4.0 Frameset Doctype */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
9bff9681643af9bc0e6b82fac0808a641c07e393takashi "DTD HTML 4.0 Frameset//EN\"\n" \
71c10d94d9dcec087859cdb44231ccc02ecaef9dnilgun "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi#define HTTP_VERSION(major,minor) (1000*(major)+(minor))
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** Major part of HTTP protocol */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/** Minor part of HTTP protocol */
9bff9681643af9bc0e6b82fac0808a641c07e393takashi/* -------------- Port number for server running standalone --------------- */
* in http_main.c so we can keep track of various errors.
#ifndef AP_DECLARE
#ifndef AP_DECLARE_NONSTD
#ifndef AP_DECLARE_DATA
# define AP_DECLARE_DATA
#ifndef AP_MODULE_DECLARE
#ifndef AP_MODULE_DECLARE_NONSTD
#ifndef AP_MODULE_DECLARE_DATA
# define AP_MODULE_DECLARE_DATA
#ifndef AP_CORE_DECLARE
#ifndef AP_CORE_DECLARE_NONSTD
* The size of the static array in http_protocol.c for storing
#define ap_status_drops_connection(x) \
(((x) == HTTP_BAD_REQUEST) || \
((x) == HTTP_REQUEST_TIME_OUT) || \
((x) == HTTP_LENGTH_REQUIRED) || \
((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
((x) == HTTP_INTERNAL_SERVER_ERROR) || \
((x) == HTTP_SERVICE_UNAVAILABLE) || \
((x) == HTTP_NOT_IMPLEMENTED))
* This list must be tracked by the list in http_protocol.c in routine
struct ap_method_list_t {
#if !APR_CHARSET_EBCDIC
#define REQUEST_NO_BODY 0
#define AP_REQ_ACCEPT_PATH_INFO 0
struct htaccess_result {
const char *dir;
int override;
/* ### would be nice to not include this from httpd.h ... */
#include "apr_uri.h"
struct process_rec {
int argc;
const char * const *argv;
const char *short_name;
struct request_rec {
/** If this is a sub_request (see request.h) pointer back to the
* protocol.c should ever touch...
char *the_request;
int assbackwards;
/** A proxy request (calculated during post_read_request/translate_name)
int proxyreq;
int header_only;
char *protocol;
int proto_num;
const char *hostname;
const char *status_line;
int status;
/* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
const char *method;
int method_number;
int chunked;
const char *range;
int read_body;
int read_chunked;
unsigned expecting_100;
const char *content_encoding;
char *vlist_validator;
char *user;
char *ap_auth_type;
int no_cache;
int no_local_copy;
char *unparsed_uri;
char *uri;
char *filename;
char *canonical_filename;
char *path_info;
char *args;
int used_path_info;
int eos_sent;
struct conn_rec {
/** used by http_vhost.c */
void *vhost_lookup_data;
char *remote_ip;
char *remote_host;
char *remote_logname;
int keepalives;
char *local_ip;
char *local_host;
long id;
void *sbh;
struct server_addr_rec {
char *virthost;
struct server_rec {
const char *defn_name;
unsigned defn_line_number;
char *server_admin;
char *server_hostname;
char *error_fname;
int loglevel;
int is_virtual;
int timeout;
int keep_alive_timeout;
int keep_alive_max;
int keep_alive;
const char *path;
int pathlen;
int limit_req_line;
int limit_req_fieldsize;
int limit_req_fields;
typedef struct core_output_filter_ctx {
typedef struct core_filter_ctx {
} core_ctx_t;
typedef struct core_net_rec {
conn_rec *c;
} core_net_rec;
* Examine a field value (such as a media-/content-type) string and return
char stop);
const char *prefix);
int cflags);
* 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