httpd.h revision 9346b854b0827ae0645b456ffd2b4938f1e73c03
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* ====================================================================
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * The Apache Software License, Version 1.1
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis * Copyright (c) 2000 The Apache Software Foundation. All rights
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * reserved.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * Redistribution and use in source and binary forms, with or without
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * modification, are permitted provided that the following conditions
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 1. Redistributions of source code must retain the above copyright
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * notice, this list of conditions and the following disclaimer.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 2. Redistributions in binary form must reproduce the above copyright
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * notice, this list of conditions and the following disclaimer in
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * the documentation and/or other materials provided with the
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * distribution.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 3. The end-user documentation included with the redistribution,
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * if any, must include the following acknowledgment:
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * "This product includes software developed by the
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * Apache Software Foundation (http://www.apache.org/)."
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * Alternately, this acknowledgment may appear in the software itself,
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * if and wherever such third-party acknowledgments normally appear.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 4. The names "Apache" and "Apache Software Foundation" must
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * not be used to endorse or promote products derived from this
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * software without prior written permission. For written
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * permission, please contact apache@apache.org.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 5. Products derived from this software may not be called "Apache",
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * nor may "Apache" appear in their name, without prior written
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * permission of the Apache Software Foundation.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * SUCH DAMAGE.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * ====================================================================
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * This software consists of voluntary contributions made by many
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * individuals on behalf of the Apache Software Foundation. For more
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * information on the Apache Software Foundation, please see
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * Portions of this software are based upon public domain software
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * originally written at the National Center for Supercomputing Applications,
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * University of Illinois, Urbana-Champaign.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzorextern "C" {
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * httpd.h: header for simple (ha! not anymore) http daemon
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* XXX - We need to push more stuff to other .h files, or even .c files, to
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis * make this file smaller
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Headers in which EVERYONE has an interest... */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* ----------------------------- config dir ------------------------------ */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Define this to be the default server home dir. Most things later in this
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * file with a relative pathname will have this added.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Set default for OS/2 file system */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Set default for Windows file system */
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis/* Set the default for BeOS */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* HTTPD_ROOT */
5e6dcc287b64eb58282c020e8a91a8bfb6ac0339lgentis * --------- You shouldn't have to edit anything below this line ----------
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis * Any modifications to any defaults not defined above should be done in the
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis * respective config. file.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Default location of documents. Can be overridden by the DocumentRoot
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * directive.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Set default for OS/2 file system */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* DOCUMENT_LOCATION */
c8653decd49c1f7d0b15625c925b6be201660e13lgentis/* Max. number of dynamically loaded modules */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Default administrator's address */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The target name of the installed Apache */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* --------- Default user name and group name ----------------------------- */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* --- These may be specified as numbers by placing a # before a number --- */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The name of the log files */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* DEFAULT_XFERLOG */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* DEFAULT_ERRORLOG */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Define this to be what your per-directory security files are called */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Set default for OS/2 file system */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* DEFAULT_ACCESS_FNAME */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The name of the server config file */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Whether we should enable rfc1413 identity checking */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The default path for CGI scripts if none is currently set */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The path to the suExec wrapper, can be overridden in Configuration */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The timeout for waiting for messages */
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis/* The timeout for waiting for keepalive timeout until next request */
5afb587bf5f22668d06e92e49b4ff0522f1cb79algentis/* The number of requests to entertain per connection */
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* The maximum length of the queue of pending connections, as defined
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * by listen(2). Under some systems, it should be increased if you
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * are experiencing a heavy TCP SYN flood attack.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * It defaults to 511 instead of 512 because some systems store it
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * as an 8-bit datatype; 512 truncated to 8-bits is 0, while 511 is
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * 255 when truncated.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor/* Limits on the size of various request items. These limits primarily
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * exist to prevent simple denial-of-service attacks on a server based
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * on misuse of the protocol. The recommended values will depend on the
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * nature of the server resources -- CGI scripts and database backends
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * might require large values, but most servers could get by with much
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * smaller limits than we use below. The request message body size can
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * be limited by the per-dir config directive LimitRequestBody.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * These two limits can be lowered (but not raised) by the server config
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * directives LimitRequestLine and LimitRequestFieldsize, respectively.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor * the server config directive LimitRequestFields.
d33f63cbb2e396bb5b6f5d36465dd9506f76fdf9gryzor#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */
#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
#ifndef DEFAULT_INDEXING
#define DEFAULT_INDEXING 0
#ifndef AP_DEFAULT_INDEX
#ifndef DEFAULT_CONTENT_TYPE
#ifndef AP_TYPES_CONFIG_FILE
* in http_main.c so we can keep track of various errors.
enum server_token_type {
#define ap_add_version_component(x) ((void)0)
/* 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))
#define M_GET 0
#ifdef CHARSET_EBCDIC
#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */
#ifndef CHARSET_EBCDIC
#define REQUEST_NO_BODY 0
struct htaccess_result {
#include "util_uri.h"
struct process_rec {
int argc;
const char **argv;
const char *short_name;
struct request_rec {
* protocol.c should ever touch...
/* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
const char *content_encoding;
int no_cache;
int no_local_copy;
char *filename;
char *path_info;
struct conn_rec {
struct server_addr_rec {
struct server_rec {
const char *defn_name;
unsigned defn_line_number;
char *server_admin;
char *server_hostname;
char *error_fname;
int loglevel;
#ifndef API_EXPORT
#ifndef API_EXPORT_NONSTD
#ifndef MODULE_VAR_EXPORT
#define MODULE_VAR_EXPORT
#ifndef API_VAR_EXPORT
#define API_VAR_EXPORT
#ifndef CORE_EXPORT
#ifndef CORE_EXPORT_NONSTD
#ifndef ap_private_extern
#define ap_private_extern
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *a, const char *b);
#ifndef HAVE_STRNCASECMP
#include "hsregex.h"
#include <regex.h>
int cflags);
#ifdef _OSD_POSIX
#ifdef DEBUG_SIGSTOP
extern int raise_sigstop_flags;
#define RAISE_SIGSTOP(x) do { \
#define RAISE_SIGSTOP(x)
#ifdef strtoul
#ifdef __cplusplus