httpd.h revision 5f7c351eb2a69d8cef6c3e98e27ce6158a0b1780
* 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * ==================================================================== * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * httpd.h: header for simple (ha! not anymore) http daemon /* XXX - We need to push more stuff to other .h files, or even .c files, to /* Headers in which EVERYONE has an interest... */ /* ----------------------------- 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. /* Set default for OS/2 file system */ /* Set default for Windows file system */ /* Set the default for BeOS */ * --------- You shouldn't have to edit anything below this line ---------- * Any modifications to any defaults not defined above should be done in the * respective config. file. /* Default location of documents. Can be overridden by the DocumentRoot /* Set default for OS/2 file system */ #
endif /* DOCUMENT_LOCATION *//* Max. number of dynamically loaded modules */ /* Default administrator's address */ /* The target name of the installed Apache */ /* --------- Default user name and group name ----------------------------- */ /* --- These may be specified as numbers by placing a # before a number --- */ /* The name of the log files */ #
endif /* DEFAULT_XFERLOG */#
endif /* DEFAULT_ERRORLOG *//* Define this to be what your per-directory security files are called */ /* Set default for OS/2 file system */ #
endif /* DEFAULT_ACCESS_FNAME *//* The name of the server config file */ /* Whether we should enable rfc1413 identity checking */ /* The default path for CGI scripts if none is currently set */ /* The path to the suExec wrapper, can be overridden in Configuration */ /* The timeout for waiting for messages */ /* The timeout for waiting for keepalive timeout until next request */ /* The number of requests to entertain per connection */ /* The maximum length of the queue of pending connections, as defined * by listen(2). Under some systems, it should be increased if you * are experiencing a heavy TCP SYN flood attack. * It defaults to 511 instead of 512 because some systems store it * as an 8-bit datatype; 512 truncated to 8-bits is 0, while 511 is /* 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. #
endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */#
endif /* default limit on bytes in any one header field */#
endif /* default limit on number of request header fields */ * The default default character set name to add if AddDefaultCharset is * enabled. Overridden with AddDefaultCharsetName. * The below defines the base string of the Server: header. Additional * tokens can be added via the ap_add_version_component() API call. * The tokens are listed in order of their significance for identifying the * "Product tokens should be short and to the point -- use of them for * advertizing or other non-essential information is explicitly forbidden." * Example: "Apache/1.1.0 MrWidget/0.1-alpha" /* Define this to 1 if you want fancy indexing, 0 otherwise */ #
endif /* CORE_PRIVATE *//* ------------------ stuff that modules are allowed to look at ----------- */ /* Define this to be what your HTML directory content files are called */ /* Define this to be what type you'd like returned for files with unknown */ /* suffixes. MUST be all lower case. */ /* The name of the MIME types file */ * Define the HTML doctype strings centrally. "DTD HTML 3.2 Final//EN\">\n" "DTD HTML 4.0 Transitional//EN\"\n" \
"DTD HTML 4.0 Frameset//EN\"\n" \
/* -- Internal representation for a HTTP protocol number, e.g., HTTP/1.1 -- */ /* -------------- Port number for server running standalone --------------- */ /* The default string lengths */ /* The size of the server's internal read-write buffers */ * Special Apache error codes. These are basically used * in http_main.c so we can keep track of various errors. * A fatal error arising during the server's init sequence * The child died during it's init sequence * 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. SrvTk_FULL,
/* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ /* Numeric release version identifier: MMNNFFRBB: major minor fix final beta * Always increases along the same track as the source branch. * For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'. #
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. *//* ----------------------- HTTP Status Codes ------------------------- */ * all of the potential response status-lines (a sparse table). * A future version should dynamically generate the ap_table_t at startup. /* Methods recognized (but not necessarily handled) by the server. * These constants are used in bit shifting masks of size int, so it is * unsafe to have more methods than bits in an int. HEAD == M_GET. #
endif /*CHARSET_EBCDIC*//* Just in case your linefeed isn't the one the other end is expecting. */ #
else /* CHARSET_EBCDIC *//* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done * "native EBCDIC" CR and NL characters. These are therefore #
endif /* CHARSET_EBCDIC *//* Possible values for request_rec.read_body (set by handling module): * REQUEST_NO_BODY Send 413 error if message has any body * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me. * REQUEST_CHUNKED_PASS Pass the chunks to me without removal. /* Things which may vary per file-lookup WITHIN a request --- * e.g., state of MIME config. Basically, the name of an object, info * about the object, and any other info we may ahve which may need to * change as we go poking around looking for it (e.g., overridden by * Note how the default state of almost all these things is properly * zero, so that allocating it with pcalloc does the right thing without * a whole lot of hairy initialization... so long as we are willing to * make the (fairly) portable assumption that the bit pattern of a NULL * pointer is, in fact, zero. /* This represents the result of calling htaccess; these are cached for const char *
dir;
/* the directory to which this applies */ int override;
/* the overrides allowed for the .htaccess file */ void *
htaccess;
/* the configuration directives */ /* the next one, or NULL if no more; N.B. never change this */ /* The following four types define a hierarchy of activities, so that * given a request_rec r you can write r->connection->server->process * to get to the process_rec. While this reduces substantially the * number of arguments that various hooks require beware that in * threaded versions of the server you must consider multiplexing /* contents are experimental! expect it to change! */ int to_net_sb;
/* whether or not write translation is single-byte-only */ ap_pool_t *
pool;
/* Global pool. Please try to cleared on _all_ exits */ * pointer to the request we redirected to. * pointer to where we redirected *from*. * pointer back to the main request. /* Info about the request itself... we begin with stuff that only char *
the_request;
/* First line of request, so we can log it */ int proxyreq;
/* A proxy request (calculated during * post_read_request or translate_name) */ char *
protocol;
/* Protocol, as given to us, or HTTP/0.9 */ int proto_num;
/* Number version of protocol; 1.1 = 1001 */ const char *
hostname;
/* Host, as set by full URI or Host: */ const char *
status_line;
/* Status line, if set by script */ /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, const char *
method;
/* GET, HEAD, POST, etc. */ allowed is a bitvector of the allowed methods. A handler must ensure that the request method is one that it is capable of handling. Generally modules should DECLINE any request methods they do not handle. Prior to aborting the handler like this the handler should set r->allowed to the list of methods that it is willing to handle. This bitvector is used to construct the "Allow:" header required for OPTIONS requests, and METHOD_NOT_ALLOWED and NOT_IMPLEMENTED status codes. Since the default_handler deals with OPTIONS, all modules can usually decline to deal with OPTIONS. TRACE is always allowed, modules don't need to set it explicitly. Since the default_handler will always handle a GET, a module which does *not* implement GET should probably return METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET handler can't be installed by mod_actions. int allowed;
/* Allowed methods - for 405, OPTIONS, etc */ int sent_bodyct;
/* byte count in stream is for body */ long bytes_sent;
/* body byte count, for easy access */ /* HTTP/1.1 connection-level features */ int chunked;
/* sending chunked transfer-coding */ const char *
range;
/* The Range: header */ long clength;
/* The "real" content length */ int read_body;
/* how the request body should be read */ unsigned expecting_100;
/* is client waiting for a 100 response? */ /* MIME header environments, in and out. Also, an array containing * environment variables to be passed to subprocesses, so people can * write modules to add to that environment. * The difference between headers_out and err_headers_out is that the * latter are printed even on error, and persist across internal redirects * (so the headers printed for ErrorDocument handlers will have them). * The 'notes' ap_table_t is for notes from one module to another, with no * other set purpose in mind... /* content_type, handler, content_encoding, content_language, and all * content_languages MUST be lowercased strings. They may be pointers * to static strings; they should not be modified in place. const char *
content_type;
/* Break these out --- we dispatch on 'em */ const char *
handler;
/* What we *really* dispatch on */ char *
user;
/* If an authentication check was made, * this gets set to the user name. /* What object is being requested (either directly, or via include * or content-negotiation mapping). char *
unparsed_uri;
/* the uri without any parsing performed */ char *
uri;
/* the path portion of the URI */ char *
args;
/* QUERY_ARGS, if any */ /* Various other config info which may change with .htaccess files * These are config vectors, with one void* pointer for each module * (the thing pointed to being the module's business). * a linked list of the configuration directives in the .htaccess files * accessed by this request. * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list /* Things placed at the end of the record to avoid breaking binary * compatibility. It would be nice to remember to reorder the entire * record to improve 64bit alignment the next time we need to break * binary compatibility for some other reason. /* Things which are per connection /* Information about the connection itself */ * NULL if DNS hasn't been checked, * "" if it has and no address was found. * N.B. Only access this though * N.B. Only access this through * get_remote_logname() */ unsigned aborted:
1;
/* Are we still talking? */ signed int keepalive:
2;
/* Are we using HTTP Keep-Alive? * -1 fatal error, 0 undecided, 1 yes */ unsigned keptalive:
1;
/* Did we use HTTP Keep-Alive? */ int keepalives;
/* How many times have we used it? */ char *
local_host;
/* used for ap_get_server_name when * UseCanonicalName is set to DNS * (ignores setting of HostnameLookups) */ long id;
/* ID of this connection; unique at any * remain valid for all requests on this conn */ /* Per-vhost config... */ /* The address 255.255.255.255, when used as a virtualhost address, * will become the "default" server when the ip doesn't match other vhosts. unsigned short host_port;
/* The bound port, for this server */ char *
virthost;
/* The name given in <VirtualHost> */ /* description of where the definition came from */ /* Contact information */ unsigned short port;
/* for redirects, etc. */ /* Log files --- note that transfer log is now in the modules... */ /* Module-specific configuration for server, and defaults... */ int is_virtual;
/* true if this is the virtual server */ * modules' per-server config structures. * checking per-directory info. /* Transaction handling */ int timeout;
/* Timeout, in seconds, before we give up */ const char *
path;
/* Pathname for ServerPath */ /* stuff marked API_EXPORT is part of the API, and intended for use /* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for * use by modules. The difference between API_EXPORT and * API_EXPORT_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. /* modules should not used functions marked CORE_EXPORT * or CORE_EXPORT_NONSTD */ /* On Mac OS X Server, symbols that conflict with loaded dylibs * (eg. System framework) need to be declared as private symbols with * For other systems, make that a no-op. /* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const /* deprecated. The previous two routines are preferred. */ /* Misc system hackery */ * Redefine assert() to something more useful for an Apache... /* A set of flags which indicate places where the server should raise(SIGSTOP). * This is useful for debugging, because you can then attach to that process * with gdb and continue. This is important in cases where one_process * debugging isn't possible. /* strtoul does not exist on sunos4. */ /* The C library has functions that allow const to be silently dropped ... these macros detect the drop in maintainer mode, but use the native methods far narmal builds #
endif /* !APACHE_HTTPD_H */