⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpd.h

📁 Apache HTTP Server 是一个功能强大的灵活的与HTTP/1.1相兼容的web服务器.这里给出的是Apache HTTP服务器的源码。
💻 H
📖 第 1 页 / 共 4 页
字号:
/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */#ifndef APACHE_HTTPD_H#define APACHE_HTTPD_H/** * @file httpd.h * @brief HTTP Daemon routines *//* XXX - We need to push more stuff to other .h files, or even .c files, to * make this file smaller *//* Headers in which EVERYONE has an interest... */#include "ap_config.h"#include "ap_mmn.h"#include "ap_release.h"#include "apr_general.h"#include "apr_tables.h"#include "apr_pools.h"#include "apr_time.h"#include "apr_network_io.h"#include "apr_buckets.h"#include "os.h"#include "pcreposix.h"/* Note: util_uri.h is also included, see below */#ifdef __cplusplusextern "C" {#endif#ifdef CORE_PRIVATE/* ----------------------------- config dir ------------------------------ *//* Define this to be the default server home dir. Most things later in this * file with a relative pathname will have this added. */#ifndef HTTPD_ROOT#ifdef OS2/* Set default for OS/2 file system */#define HTTPD_ROOT "/os2httpd"#elif defined(WIN32)/* Set default for Windows file system */#define HTTPD_ROOT "/apache"#elif defined (BEOS)/* Set the default for BeOS */#define HTTPD_ROOT "/boot/home/apache"#elif defined (NETWARE)/* Set the default for NetWare */#define HTTPD_ROOT "/apache"#else#define HTTPD_ROOT "/usr/local/apache"#endif#endif /* HTTPD_ROOT *//*  * --------- You shouldn't have to edit anything below this line ---------- * * Any modifications to any defaults not defined above should be done in the  * respective configuration file.  * *//* Default location of documents.  Can be overridden by the DocumentRoot * directive. */#ifndef DOCUMENT_LOCATION#ifdef OS2/* Set default for OS/2 file system */#define DOCUMENT_LOCATION  HTTPD_ROOT "/docs"#else#define DOCUMENT_LOCATION  HTTPD_ROOT "/htdocs"#endif#endif /* DOCUMENT_LOCATION *//* Maximum number of dynamically loaded modules */#ifndef DYNAMIC_MODULE_LIMIT#define DYNAMIC_MODULE_LIMIT 64#endif/* Default administrator's address */#define DEFAULT_ADMIN "[no address given]"/* The name of the log files */#ifndef DEFAULT_ERRORLOG#if defined(OS2) || defined(WIN32)#define DEFAULT_ERRORLOG "logs/error.log"#else#define DEFAULT_ERRORLOG "logs/error_log"#endif#endif /* DEFAULT_ERRORLOG *//* Define this to be what your per-directory security files are called */#ifndef DEFAULT_ACCESS_FNAME#ifdef OS2/* Set default for OS/2 file system */#define DEFAULT_ACCESS_FNAME "htaccess"#else#define DEFAULT_ACCESS_FNAME ".htaccess"#endif#endif /* DEFAULT_ACCESS_FNAME *//* The name of the server config file */#ifndef SERVER_CONFIG_FILE#define SERVER_CONFIG_FILE "conf/httpd.conf"#endif/* Whether we should enable rfc1413 identity checking */#ifndef DEFAULT_RFC1413#define DEFAULT_RFC1413 0#endif/* The default path for CGI scripts if none is currently set */#ifndef DEFAULT_PATH#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"#endif/* The path to the suExec wrapper, can be overridden in Configuration */#ifndef SUEXEC_BIN#define SUEXEC_BIN  HTTPD_ROOT "/bin/suexec"#endif/* The timeout for waiting for messages */#ifndef DEFAULT_TIMEOUT#define DEFAULT_TIMEOUT 300 #endif/* The timeout for waiting for keepalive timeout until next request */#ifndef DEFAULT_KEEPALIVE_TIMEOUT#define DEFAULT_KEEPALIVE_TIMEOUT 15#endif/* The number of requests to entertain per connection */#ifndef DEFAULT_KEEPALIVE#define DEFAULT_KEEPALIVE 100#endif/* Limits on the size of various request items.  These limits primarily * exist to prevent simple denial-of-service attacks on a server based * on misuse of the protocol.  The recommended values will depend on the * nature of the server resources -- CGI scripts and database backends * might require large values, but most servers could get by with much * smaller limits than we use below.  The request message body size can * be limited by the per-dir config directive LimitRequestBody. * * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190. * These two limits can be lowered (but not raised) by the server config * directives LimitRequestLine and LimitRequestFieldsize, respectively. * * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by * the server config directive LimitRequestFields. */#ifndef DEFAULT_LIMIT_REQUEST_LINE#define DEFAULT_LIMIT_REQUEST_LINE 8190#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */#ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190#endif /* default limit on bytes in any one header field  */#ifndef DEFAULT_LIMIT_REQUEST_FIELDS#define DEFAULT_LIMIT_REQUEST_FIELDS 100#endif /* default limit on number of request header fields *//** * The default default character set name to add if AddDefaultCharset is * enabled.  Overridden with AddDefaultCharsetName. */#define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"#endif /* CORE_PRIVATE *//** default HTTP Server protocol */#define AP_SERVER_PROTOCOL "HTTP/1.1"/* ------------------ stuff that modules are allowed to look at ----------- *//** Define this to be what your HTML directory content files are called */#ifndef AP_DEFAULT_INDEX#define AP_DEFAULT_INDEX "index.html"#endif/**  * Define this to be what type you'd like returned for files with unknown  * suffixes.   * @warning MUST be all lower case.  */#ifndef DEFAULT_CONTENT_TYPE#define DEFAULT_CONTENT_TYPE "text/plain"#endif/** The name of the MIME types file */#ifndef AP_TYPES_CONFIG_FILE#define AP_TYPES_CONFIG_FILE "conf/mime.types"#endif/* * Define the HTML doctype strings centrally. *//** HTML 2.0 Doctype */#define DOCTYPE_HTML_2_0  "<!DOCTYPE HTML PUBLIC \"-//IETF//" \                          "DTD HTML 2.0//EN\">\n"/** HTML 3.2 Doctype */#define DOCTYPE_HTML_3_2  "<!DOCTYPE HTML PUBLIC \"-//W3C//" \                          "DTD HTML 3.2 Final//EN\">\n"/** HTML 4.0 Strict Doctype */#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \                          "DTD HTML 4.0//EN\"\n" \                          "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"/** HTML 4.0 Transitional Doctype */#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \                          "DTD HTML 4.0 Transitional//EN\"\n" \                          "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"/** HTML 4.0 Frameset Doctype */#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \                          "DTD HTML 4.0 Frameset//EN\"\n" \                          "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"/** XHTML 1.0 Strict Doctype */#define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \                           "DTD XHTML 1.0 Strict//EN\"\n" \                           "\"http://www.w3.org/TR/xhtml1/DTD/" \                           "xhtml1-strict.dtd\">\n"/** XHTML 1.0 Transitional Doctype */#define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \                           "DTD XHTML 1.0 Transitional//EN\"\n" \                           "\"http://www.w3.org/TR/xhtml1/DTD/" \                           "xhtml1-transitional.dtd\">\n"/** XHTML 1.0 Frameset Doctype */#define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \                           "DTD XHTML 1.0 Frameset//EN\"\n" \                           "\"http://www.w3.org/TR/xhtml1/DTD/" \                           "xhtml1-frameset.dtd\">"/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */#define HTTP_VERSION(major,minor) (1000*(major)+(minor))/** Major part of HTTP protocol */#define HTTP_VERSION_MAJOR(number) ((number)/1000)/** Minor part of HTTP protocol */#define HTTP_VERSION_MINOR(number) ((number)%1000)/* -------------- Port number for server running standalone --------------- *//** default HTTP Port */#define DEFAULT_HTTP_PORT	80/** default HTTPS Port */#define DEFAULT_HTTPS_PORT	443/** * Check whether @a port is the default port for the request @a r. * @param port The port number * @param r The request * @see #ap_default_port */#define ap_is_default_port(port,r)	((port) == ap_default_port(r))/** * Get the default port for a request (which depends on the scheme). * @param r The request */#define ap_default_port(r)	ap_run_default_port(r)/** * Get the scheme for a request. * @param r The request * @bug This should be called ap_http_scheme! */#define ap_http_method(r)	ap_run_http_method(r)/** The default string lengths */#define MAX_STRING_LEN HUGE_STRING_LEN#define HUGE_STRING_LEN 8192/** The size of the server's internal read-write buffers */#define AP_IOBUFSIZE 8192/** The max number of regex captures that can be expanded by ap_pregsub */#define AP_MAX_REG_MATCH 10/** * APR_HAS_LARGE_FILES introduces the problem of spliting sendfile into  * mutiple buckets, no greater than MAX(apr_size_t), and more granular  * than that in case the brigade code/filters attempt to read it directly. * ### 16mb is an invention, no idea if it is reasonable. */#define AP_MAX_SENDFILE 16777216  /* 2^24 *//** * Special Apache error codes. These are basically used *  in http_main.c so we can keep track of various errors. *         *//** a normal exit */#define APEXIT_OK		0x0/** A fatal error arising during the server's init sequence */#define APEXIT_INIT		0x2/**  The child died during its init sequence */#define APEXIT_CHILDINIT	0x3/**   *   The child exited due to a resource shortage. *   The parent should limit the rate of forking until *   the situation is resolved. */#define APEXIT_CHILDSICK        0x7/**  *     A fatal error, resulting in the whole server aborting. *     If a child exits with this error, the parent process *     considers this a server-wide fatal error and aborts. */#define APEXIT_CHILDFATAL	0xf#ifndef AP_DECLARE/** * Stuff marked #AP_DECLARE is part of the API, and intended for use * by modules. Its purpose is to allow us to add attributes that * particular platforms or compilers require to every exported function. */# define AP_DECLARE(type)    type#endif#ifndef AP_DECLARE_NONSTD/** * Stuff marked #AP_DECLARE_NONSTD is part of the API, and intended for * use by modules.  The difference between #AP_DECLARE and * #AP_DECLARE_NONSTD is that the latter is required for any functions * which use varargs or are used via indirect function call.  This * is to accomodate the two calling conventions in windows dlls. */# define AP_DECLARE_NONSTD(type)    type#endif#ifndef AP_DECLARE_DATA# define AP_DECLARE_DATA#endif#ifndef AP_MODULE_DECLARE# define AP_MODULE_DECLARE(type)    type#endif#ifndef AP_MODULE_DECLARE_NONSTD# define AP_MODULE_DECLARE_NONSTD(type)  type#endif#ifndef AP_MODULE_DECLARE_DATA# define AP_MODULE_DECLARE_DATA#endif/** * @internal * modules should not used functions marked AP_CORE_DECLARE */#ifndef AP_CORE_DECLARE# define AP_CORE_DECLARE	AP_DECLARE#endif/** * @internal * modules should not used functions marked AP_CORE_DECLARE_NONSTD */#ifndef AP_CORE_DECLARE_NONSTD# define AP_CORE_DECLARE_NONSTD	AP_DECLARE_NONSTD#endif/** * Get the server version string * @return The server version string */AP_DECLARE(const char *) ap_get_server_version(void);/** * Add a component to the version string * @param pconf The pool to allocate the component from * @param component The string to add */AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);/** * Get the date a time that the server was built * @return The server build time string */AP_DECLARE(const char *) ap_get_server_built(void);#define DECLINED -1		/**< Module declines to handle */#define DONE -2			/**< Module has served the response completely 				 *  - it's safe to die() with no more output				 */#define OK 0			/**< Module has handled this stage. *//** * @defgroup HTTP_Status HTTP Status Codes * @{ *//** * The size of the static array in http_protocol.c for storing * all of the potential response status-lines (a sparse table). * A future version should dynamically generate the apr_table_t at startup. */#define RESPONSE_CODES 57#define HTTP_CONTINUE                      100#define HTTP_SWITCHING_PROTOCOLS           101#define HTTP_PROCESSING                    102#define HTTP_OK                            200#define HTTP_CREATED                       201#define HTTP_ACCEPTED                      202#define HTTP_NON_AUTHORITATIVE             203#define HTTP_NO_CONTENT                    204#define HTTP_RESET_CONTENT                 205#define HTTP_PARTIAL_CONTENT               206#define HTTP_MULTI_STATUS                  207#define HTTP_MULTIPLE_CHOICES              300#define HTTP_MOVED_PERMANENTLY             301#define HTTP_MOVED_TEMPORARILY             302#define HTTP_SEE_OTHER                     303#define HTTP_NOT_MODIFIED                  304#define HTTP_USE_PROXY                     305#define HTTP_TEMPORARY_REDIRECT            307#define HTTP_BAD_REQUEST                   400

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -