http_core.h revision 78b8e4dd910f03af0a602bc4b63ad7bc69868ee3
78N/A/* Licensed to the Apache Software Foundation (ASF) under one or more 78N/A * contributor license agreements. See the NOTICE file distributed with 78N/A * this work for additional information regarding copyright ownership. 78N/A * The ASF licenses this file to You under the Apache License, Version 2.0 78N/A * (the "License"); you may not use this file except in compliance with 78N/A * the License. You may obtain a copy of the License at 78N/A * Unless required by applicable law or agreed to in writing, software 78N/A * distributed under the License is distributed on an "AS IS" BASIS, 78N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78N/A * See the License for the specific language governing permissions and 78N/A * limitations under the License. 78N/A * @brief CORE HTTP Daemon 78N/A * @defgroup APACHE_CORE_HTTPD Core HTTP Daemon 78N/A * @ingroup APACHE_CORE 78N/A/* **************************************************************** 78N/A * The most basic server code is encapsulated in a single module 78N/A * known as the core, which is just *barely* functional enough to 78N/A * serve documents, though not terribly well. 78N/A * Largely for NCSA back-compatibility reasons, the core needs to 78N/A * make pieces of its config structures available to other modules. 78N/A * The accessors are declared here, along with the interpretation 78N/A * of one of them (allow_options). 78N/A * @defgroup APACHE_CORE_HTTPD_ACESSORS Acessors 78N/A/** No directives */ 78N/A/** Indexes directive */ 78N/A/** SSI is enabled without exec= permission */ 78N/A/** FollowSymLinks directive */ 78N/A/** ExecCGI directive */ 78N/A/** directive unset */ 78N/A/** SSI exec= permission is permitted, iff OPT_INCLUDES is also set */ 78N/A/** SymLinksIfOwnerMatch directive */ 78N/A/** MultiViews directive */ 78N/A/** All directives */ 78N/A * @defgroup get_remote_host Remote Host Resolution 78N/A * @ingroup APACHE_CORE_HTTPD 78N/A/** REMOTE_HOST returns the hostname, or NULL if the hostname 78N/A * lookup fails. It will force a DNS lookup according to the 78N/A * HostnameLookups setting. 78N/A/** REMOTE_NAME returns the hostname, or the dotted quad if the 78N/A * hostname lookup fails. It will force a DNS lookup according 78N/A * to the HostnameLookups setting. 78N/A/** REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is 78N/A/** REMOTE_DOUBLE_REV will always force a DNS lookup, and also force 78N/A * a double reverse lookup, regardless of the HostnameLookups 78N/A * setting. The result is the (double reverse checked) hostname, 78N/A * or NULL if any of the lookups fail. 78N/A/** @} // get_remote_host */ 78N/A/** all of the requirements must be met */ 78N/A/** any of the requirements must be met */ 78N/A/** There are no applicable satisfy lines */ 78N/A/** Make sure we don't write less than 8000 bytes at any one time. 78N/A/** default maximum of internal redirects */ 78N/A/** default maximum subrequest nesting level */ 78N/A * Retrieve the value of Options for this request 78N/A * @param r The current request 78N/A * @return the Options bitmask 78N/A * Retrieve the value of the AllowOverride for this request 78N/A * @param r The current request 78N/A * @return the overrides bitmask 78N/A * Retrieve the document root for this server 78N/A * @param r The current request 78N/A * @warning Don't use this! If your request went through a Userdir, or 78N/A * something like that, it'll screw you. But it's back-compatible... 78N/A * @return The document root 78N/A * Lookup the remote client's DNS name or IP address 78N/A * @ingroup get_remote_host 78N/A * @param conn The current connection 78N/A * @param dir_config The directory config vector from the request 78N/A * @param type The type of lookup to perform. One of: 78N/A * REMOTE_HOST returns the hostname, or NULL if the hostname 78N/A * lookup fails. It will force a DNS lookup according to the 78N/A * HostnameLookups setting. 78N/A * REMOTE_NAME returns the hostname, or the dotted quad if the 78N/A * hostname lookup fails. It will force a DNS lookup according 78N/A * to the HostnameLookups setting. 78N/A * REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is 78N/A * REMOTE_DOUBLE_REV will always force a DNS lookup, and also force 78N/A * a double reverse lookup, regardless of the HostnameLookups 78N/A * setting. The result is the (double reverse checked) 78N/A * hostname, or NULL if any of the lookups fail. 78N/A * @param str_is_ip unless NULL is passed, this will be set to non-zero on output when an IP address 78N/A * string is returned 78N/A * @return The remote hostname 78N/A * Retrieve the login name of the remote user. Undef if it could not be 78N/A * @param r The current request 78N/A * @return The user logged in to the client machine 78N/A/* Used for constructing self-referencing URLs, and things like SERVER_PORT, 78N/A * build a fully qualified URL from the uri and information in the request rec 78N/A * @param p The pool to allocate the URL from 78N/A * @param uri The path to the requested file 78N/A * @param r The current request 78N/A * @return A fully qualified URL 78N/A * Get the current server name from the request 78N/A * @param r The current request 78N/A * @return the server name 78N/A * Get the current server name from the request for the purposes 78N/A * of using in a URL. If the server name is an IPv6 literal 78N/A * address, it will be returned in URL format (e.g., "[fe80::1]"). 78N/A * @param r The current request 78N/A * @return the server name 78N/A * Get the current server port 78N/A * @param r The current request 78N/A * @return The server's port 78N/A * Return the limit on bytes in request msg body 78N/A * @param r The current request 78N/A * @return the maximum number of bytes in the request msg body 78N/A * Return the limit on bytes in XML request msg body 78N/A * @param r The current request 78N/A * @return the maximum number of bytes in XML request msg body 78N/A * Install a custom response handler for a given status 78N/A * @param r The current request 78N/A * @param status The status for which the custom response should be used 78N/A * @param string The custom response. This can be a static string, a file 78N/A * Check if the current request is beyond the configured max. number of redirects or subrequests 78N/A * @param r The current request 78N/A * @return true (is exceeded) or false 78N/A * Check for a definition from the server command line 78N/A * @param name The define to check for 78N/A * @return 1 if defined, 0 otherwise 78N/A/* FIXME! See STATUS about how */ 78N/A/* Authentication stuff. This is one of the places where compatibility 78N/A * with the old config files *really* hurts; they don't discriminate at 78N/A * all between different authentication schemes, meaning that we need 78N/A * to maintain common state for all of them in the core, and make it 78N/A * available to the other modules through interfaces. 78N/A/** @see require_line */ 78N/A * @brief A structure to keep track of authorization requirements 78N/A /** Where the require line is in the config file. */ 78N/A /** The complete string from the command line */ 78N/A * Return the type of authorization required for this request 78N/A * @param r The current request 78N/A * @return The authorization required 78N/A * Return the current Authorization realm 78N/A * @param r The current request 78N/A * @return The current authorization realm 78N/A * How the requires lines must be met. 78N/A * @param r The current request 78N/A * @return How the requirements must be met. One of: 78N/A * SATISFY_ANY -- any of the requirements must be met. 78N/A * SATISFY_ALL -- all of the requirements must be met. 78N/A * SATISFY_NOSPEC -- There are no applicable satisfy lines 78N/A * Core is also unlike other modules in being implemented in more than 78N/A * one file... so, data structures are declared here, even though most of 78N/A * @brief Per-request configuration 78N/A /** bucket brigade used by getline for look-ahead and 78N/A * ap_get_client_block for holding left-over request body */ 78N/A /** an array of per-request working data elements, accessed 78N/A * by ID using ap_get_request_note() 78N/A * (Use ap_register_request_note() during initialization 78N/A /** Custom response strings registered via ap_custom_response(), 78N/A * or NULL; check per-dir config if nothing found here 78N/A /** There is a script processor installed on the output filter chain, 78N/A * so it needs the default_handler to deliver a (script) file into 78N/A * the chain so it can process it. Normally, default_handler only 78N/A * serves files on a GET request (assuming the file is actual content), 78N/A * since other methods are not content-retrieval. This flag overrides 78N/A * that behavior, stating that the "content" is actually a script and 78N/A * won't actually be delivered as the response for the non-GET method. 78N/A /** Should addition of charset= be suppressed for this request? 78N/A/* Standard entries that are guaranteed to be accessible via 78N/A * ap_get_request_note() for each request (additional entries 78N/A * can be added with ap_register_request_note()) 78N/A * Reserve an element in the core_request_config->notes array 78N/A * for some application-specific data 78N/A * @return An integer key that can be passed to ap_get_request_note() 78N/A * during request processing to access this element for the 78N/A * Retrieve a pointer to an element in the core_request_config->notes array 78N/A * @param r The request 78N/A * @param note_num A key for the element: either a value obtained from 78N/A * ap_register_request_note() or one of the predefined AP_NOTE_* 78N/A * @return NULL if the note_num is invalid, otherwise a pointer to the 78N/A * requested note element. 78N/A * @remark At the start of a request, each note element is NULL. The 78N/A * handle provided by ap_get_request_note() is a pointer-to-pointer 78N/A * so that the caller can point the element to some app-specific 78N/A * data structure. The caller should guarantee that any such 78N/A * structure will last as long as the request itself. 78N/A * Bits of info that go into making an ETag for a file 78N/A * document. Why a long? Because char historically 78N/A * proved too short for Options, and int can be different 78N/A * sizes on different platforms. 78N/A * @brief Server Signature Enumeration 78N/A * @brief Per-directory configuration 78N/A /** the number of slashes in d */ 78N/A /** If (opts & OPT_UNSET) then no absolute assignment to options has 78N/A * invariant: (opts_add & opts_remove) == 0 78N/A * Which said another way means that the last relative (options + or -) 78N/A * assignment made to each bit is recorded in exactly one of opts_add 78N/A /* Custom response config. These can contain text or a URL to redirect to. 78N/A * if response_code_strings is NULL then there are none in the config, 78N/A * if it's not null then it's allocated to sizeof(char*)*RESPONSE_CODES. 78N/A * This lets us do quick merges in merge_core_dir_configs(). 78N/A * ap_custom_response() */ 78N/A /* Hostname resolution etc */ 78N/A /* since is_fnmatch(conf->d) was being called so frequently in 78N/A * directory_walk() and its relatives, this field was created and 78N/A * is set to the result of that call. 78N/A /* should we force a charset on any outgoing parameterless content-type? 78N/A * if so, which charset? 78N/A /* System Resource Control */ 78N/A /* logging options */ 78N/A /* Access control */ 78N/A * Run-time performance tuning 78N/A unsigned int enable_mmap :
2;
/* whether files in this dir can be mmap'ed */ 78N/A * pitched indiscriminately */ 78N/A /** per-dir log config */ 78N/A/* Per-server core configuration */ 78N/A /* Name translations --- we want the core to be able to do *something* 78N/A * so it's at least a minimally functional web server on its own (and 78N/A * can be tested that way). But let's keep it to the bare minimum: 78N/A /* Access control */ 78N/A /* recursion backstopper */ 78N/A /* TRACE control */ 78N/A/* Core filters; not exported. */ 78N/A/* ---------------------------------------------------------------------- 78N/A/* Handles for core filters */ 78N/A * their operational status. 78N/A * @param p A pool to use to create entries in the hash table 78N/A * @param val The name of the parameter(s) that is wanted. This is 78N/A * tree-structured would be in the form ('*' is all the tree, 78N/A * 'module.*' all of the module , 'module.foo.*', or 78N/A * 'module.foo.bar' ) 78N/A * @param ht The hash table to store the results. Keys are item names, and 78N/A * the values point to ap_mgmt_item_t structures. 78N/A/* ---------------------------------------------------------------------- */ 78N/A/* ---------------------------------------------------------------------- 78N/A * I/O logging with mod_logio 78N/A/* ---------------------------------------------------------------------- 78N/A * ident lookups with mod_ident 78N/A/* ---------------------------------------------------------------------- 78N/A * authorization values with mod_authz_core 78N/A/* ---------------------------------------------------------------------- 78N/A * authorization values with mod_access_compat 631N/A/* ---------------------------------------------------------------------- */ 631N/A#
endif /* !APACHE_HTTP_CORE_H */