httpd.h revision 2d2eda71267231c2526be701fe655db125852c1f
842ae4bd224140319ae7feec1872b93dfd491143fielding/* ====================================================================
842ae4bd224140319ae7feec1872b93dfd491143fielding * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
842ae4bd224140319ae7feec1872b93dfd491143fielding * Redistribution and use in source and binary forms, with or without
842ae4bd224140319ae7feec1872b93dfd491143fielding * modification, are permitted provided that the following conditions
6c47a7d40935c5508868904cba1e87ca783ec386niq * 1. Redistributions of source code must retain the above copyright
6c47a7d40935c5508868904cba1e87ca783ec386niq * notice, this list of conditions and the following disclaimer.
6c47a7d40935c5508868904cba1e87ca783ec386niq * 2. Redistributions in binary form must reproduce the above copyright
6c47a7d40935c5508868904cba1e87ca783ec386niq * notice, this list of conditions and the following disclaimer in
6c47a7d40935c5508868904cba1e87ca783ec386niq * the documentation and/or other materials provided with the
6c47a7d40935c5508868904cba1e87ca783ec386niq * distribution.
6c47a7d40935c5508868904cba1e87ca783ec386niq * 3. All advertising materials mentioning features or use of this
6c47a7d40935c5508868904cba1e87ca783ec386niq * software must display the following acknowledgment:
6c47a7d40935c5508868904cba1e87ca783ec386niq * "This product includes software developed by the Apache Group
6c47a7d40935c5508868904cba1e87ca783ec386niq * for use in the Apache HTTP server project (http://www.apache.org/)."
6c47a7d40935c5508868904cba1e87ca783ec386niq * 4. The names "Apache Server" and "Apache Group" must not be used to
6c47a7d40935c5508868904cba1e87ca783ec386niq * endorse or promote products derived from this software without
6c47a7d40935c5508868904cba1e87ca783ec386niq * prior written permission. For written permission, please contact
6c47a7d40935c5508868904cba1e87ca783ec386niq * apache@apache.org.
6c47a7d40935c5508868904cba1e87ca783ec386niq * 5. Products derived from this software may not be called "Apache"
6c47a7d40935c5508868904cba1e87ca783ec386niq * nor may "Apache" appear in their names without prior written
6c47a7d40935c5508868904cba1e87ca783ec386niq * permission of the Apache Group.
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * 6. Redistributions of any form whatsoever must retain the following
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * acknowledgment:
6c47a7d40935c5508868904cba1e87ca783ec386niq * "This product includes software developed by the Apache Group
6c47a7d40935c5508868904cba1e87ca783ec386niq * for use in the Apache HTTP server project (http://www.apache.org/)."
6c47a7d40935c5508868904cba1e87ca783ec386niq * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
6c47a7d40935c5508868904cba1e87ca783ec386niq * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
e2b6e4d548316b37b2763c7ca7c2b54f5e210ac4wrowe * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
e2b6e4d548316b37b2763c7ca7c2b54f5e210ac4wrowe * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
e2b6e4d548316b37b2763c7ca7c2b54f5e210ac4wrowe * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
e2b6e4d548316b37b2763c7ca7c2b54f5e210ac4wrowe * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6c47a7d40935c5508868904cba1e87ca783ec386niq * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
e2b6e4d548316b37b2763c7ca7c2b54f5e210ac4wrowe * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
6c47a7d40935c5508868904cba1e87ca783ec386niq * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
6c47a7d40935c5508868904cba1e87ca783ec386niq * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
6c47a7d40935c5508868904cba1e87ca783ec386niq * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
6c47a7d40935c5508868904cba1e87ca783ec386niq * OF THE POSSIBILITY OF SUCH DAMAGE.
6c47a7d40935c5508868904cba1e87ca783ec386niq * ====================================================================
6c47a7d40935c5508868904cba1e87ca783ec386niq * This software consists of voluntary contributions made by many
6c47a7d40935c5508868904cba1e87ca783ec386niq * individuals on behalf of the Apache Group and was originally based
6c47a7d40935c5508868904cba1e87ca783ec386niq * on public domain software written at the National Center for
6c47a7d40935c5508868904cba1e87ca783ec386niq * Supercomputing Applications, University of Illinois, Urbana-Champaign.
6c47a7d40935c5508868904cba1e87ca783ec386niq * For more information on the Apache Group and the Apache HTTP server
6c47a7d40935c5508868904cba1e87ca783ec386niq * project, please see <http://www.apache.org/>.
6c47a7d40935c5508868904cba1e87ca783ec386niqextern "C" {
6c47a7d40935c5508868904cba1e87ca783ec386niq * httpd.h: header for simple (ha! not anymore) http daemon
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Headers in which EVERYONE has an interest... */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* ----------------------------- config dir ------------------------------ */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Define this to be the default server home dir. Most things later in this
6c47a7d40935c5508868904cba1e87ca783ec386niq * file with a relative pathname will have this added.
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Set default for OS/2 file system */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Set default for Windows file system */
6c47a7d40935c5508868904cba1e87ca783ec386niq#endif /* HTTPD_ROOT */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Default location of documents. Can be overridden by the DocumentRoot
6c47a7d40935c5508868904cba1e87ca783ec386niq * directive.
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Set default for OS/2 file system */
6c47a7d40935c5508868904cba1e87ca783ec386niq#endif /* DOCUMENT_LOCATION */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Max. number of dynamically loaded modules */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Default administrator's address */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The target name of the installed Apache */
6c47a7d40935c5508868904cba1e87ca783ec386niq * --------- You shouldn't have to edit anything below this line ----------
6c47a7d40935c5508868904cba1e87ca783ec386niq * Any modifications to any defaults not defined above should be done in the
6c47a7d40935c5508868904cba1e87ca783ec386niq * respective config. file.
6c47a7d40935c5508868904cba1e87ca783ec386niq/* -- Internal representation for a HTTP protocol number, e.g., HTTP/1.1 -- */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* -------------- Port number for server running standalone --------------- */
6c47a7d40935c5508868904cba1e87ca783ec386niq#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
6c47a7d40935c5508868904cba1e87ca783ec386niq/* --------- Default user name and group name running standalone ---------- */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* --- These may be specified as numbers by placing a # before a number --- */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The name of the log files */
6c47a7d40935c5508868904cba1e87ca783ec386niq#endif /* DEFAULT_XFERLOG */
6c47a7d40935c5508868904cba1e87ca783ec386niq#endif /* DEFAULT_ERRORLOG */
d56bacbfefa5aa883ce5162a115747372fc38d13chrisd#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Define this to be what your HTML directory content files are called */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Define this to 1 if you want fancy indexing, 0 otherwise */
d56bacbfefa5aa883ce5162a115747372fc38d13chrisd/* Define this to be what type you'd like returned for files with unknown */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* suffixes. MUST be all lower case. */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Define this to be what your per-directory security files are called */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Set default for OS/2 file system */
6c47a7d40935c5508868904cba1e87ca783ec386niq#endif /* DEFAULT_ACCESS_FNAME */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The name of the server config file */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The name of the document config file */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The name of the MIME types file */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The name of the access file */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Whether we should enable rfc1413 identity checking */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The default directory in user's home dir */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The default path for CGI scripts if none is currently set */
6c47a7d40935c5508868904cba1e87ca783ec386niq#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The path to the shell interpreter, for parsed docs */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* Set default for OS/2 and Windows file system */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes#endif /* SHELL_PATH */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The path to the suExec wrapper, can be overridden in Configuration */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* The default string lengths */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* The timeout for waiting for messages */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* The timeout for waiting for keepalive timeout until next request */
6c47a7d40935c5508868904cba1e87ca783ec386niq/* The number of requests to entertain per connection */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* The size of the server's internal read-write buffers */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* Number of servers to spawn off by default --- also, if fewer than
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * this free when the caretaker checks, it will spawn more.
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* Maximum number of *free* server processes --- more than this, and
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * they will die off.
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* Minimum --- fewer than this, and more will be created */
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes/* Limit on the total --- clients will be locked out if more servers than
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * this are needed. It is intended solely to keep the server from crashing
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * when things get out of hand.
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * We keep a hard maximum number of servers, for two reasons --- first off,
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * in case something goes seriously wrong, we want to stop the fork bomb
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * short of actually crashing the machine we're running on by filling some
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * kernel table. Secondly, it keeps the size of the scoreboard file small
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * enough that we can read the whole thing without worrying too much about
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * the overhead.
a72211e92bab814bfa28ee086ca9b2a1a6095c92chrisd * Special Apache error codes. These are basically used
a72211e92bab814bfa28ee086ca9b2a1a6095c92chrisd * in http_main.c so we can keep track of various errors.
2e242dca7111f99d54dd144b7b8418d88d560032chrisd * APEXIT_OK:
a72211e92bab814bfa28ee086ca9b2a1a6095c92chrisd * A normal exit
a72211e92bab814bfa28ee086ca9b2a1a6095c92chrisd * APEXIT_INIT:
6c47a7d40935c5508868904cba1e87ca783ec386niq * A fatal error arising during the server's init sequence
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes * APEXIT_CHILDINIT:
6c47a7d40935c5508868904cba1e87ca783ec386niq * The child died during it's init sequence
6c47a7d40935c5508868904cba1e87ca783ec386niq * APEXIT_CHILDFATAL:
6c47a7d40935c5508868904cba1e87ca783ec386niq * A fatal error, resulting in the whole server aborting.
6c47a7d40935c5508868904cba1e87ca783ec386niq * If a child exits with this error, the parent process
6c47a7d40935c5508868904cba1e87ca783ec386niq * considers this a server-wide fatal error and aborts.
#ifndef SCOREBOARD_MAINTENANCE_INTERVAL
#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
#ifndef DEFAULT_THREADS_PER_CHILD
#define DEFAULT_EXCESS_REQUESTS_PER_CHILD 0
#ifndef DEFAULT_LISTENBACKLOG
#ifndef DEFAULT_LIMIT_REQUEST_LINE
#ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
enum server_token_type {
#ifndef SERVER_SUPPORT
/* 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
#include "ebcdic.h"
#define REQUEST_NO_BODY 0
struct htaccess_result {
#include "util_uri.h"
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 *srm_confname;
char *access_confname;
char *server_admin;
char *server_hostname;
char *error_fname;
int loglevel;
struct listen_rec {
int fd;
/* Prototypes for utilities... util.c.
extern void ap_util_init(void);
#ifdef OS2
} configfile_t;
void *param,
int(*getc_func)(void*),
#ifdef NEED_STRERROR
#ifndef HAVE_CANONICAL_FILENAME
* We can't define these in os.h because of dependence on pool pointer.
#define ap_os_canonical_filename(p,f) (f)
#define ap_os_case_canonical_filename(p,f) (f)
#define ap_os_systemcase_filename(p,f) (f)
#ifdef WIN32
#ifdef _OSD_POSIX
#ifndef LOW_SLACK_LINE
#ifdef NO_SLACK
#if !defined (MULTITHREAD) && \
#define OPTIMIZE_TIMEOUTS
#ifdef DEBUG_SIGSTOP
extern int raise_sigstop_flags;
#define RAISE_SIGSTOP(x) do { \
#define RAISE_SIGSTOP(x)
#ifdef strtoul
#ifdef __cplusplus