http_core.c revision 38ffbd0f929ac9cfc6ed5335ae61223aee3ab882
28ec5e4f5c4a71428affc986304e894eda600925takashi/* ====================================================================
89565ae25f070411b0b32505b798195a9c98a1c2mturk * The Apache Software License, Version 1.1
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd * Copyright (c) 2000 The Apache Software Foundation. All rights
89565ae25f070411b0b32505b798195a9c98a1c2mturk * reserved.
031b91a62d25106ae69d4693475c79618dd5e884fielding * Redistribution and use in source and binary forms, with or without
031b91a62d25106ae69d4693475c79618dd5e884fielding * modification, are permitted provided that the following conditions
031b91a62d25106ae69d4693475c79618dd5e884fielding * 1. Redistributions of source code must retain the above copyright
031b91a62d25106ae69d4693475c79618dd5e884fielding * notice, this list of conditions and the following disclaimer.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 2. Redistributions in binary form must reproduce the above copyright
89565ae25f070411b0b32505b798195a9c98a1c2mturk * notice, this list of conditions and the following disclaimer in
89565ae25f070411b0b32505b798195a9c98a1c2mturk * the documentation and/or other materials provided with the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * distribution.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 3. The end-user documentation included with the redistribution,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * if any, must include the following acknowledgment:
89565ae25f070411b0b32505b798195a9c98a1c2mturk * "This product includes software developed by the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Apache Software Foundation (http://www.apache.org/)."
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Alternately, this acknowledgment may appear in the software itself,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * if and wherever such third-party acknowledgments normally appear.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 4. The names "Apache" and "Apache Software Foundation" must
89565ae25f070411b0b32505b798195a9c98a1c2mturk * not be used to endorse or promote products derived from this
89565ae25f070411b0b32505b798195a9c98a1c2mturk * software without prior written permission. For written
edcb4d94a269c3b1c3fdd6473e3f91e6c20e1702takashi * permission, please contact apache@apache.org.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 5. Products derived from this software may not be called "Apache",
89565ae25f070411b0b32505b798195a9c98a1c2mturk * nor may "Apache" appear in their name, without prior written
89565ae25f070411b0b32505b798195a9c98a1c2mturk * permission of the Apache Software Foundation.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
89565ae25f070411b0b32505b798195a9c98a1c2mturk * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
89565ae25f070411b0b32505b798195a9c98a1c2mturk * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89565ae25f070411b0b32505b798195a9c98a1c2mturk * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
89565ae25f070411b0b32505b798195a9c98a1c2mturk * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89565ae25f070411b0b32505b798195a9c98a1c2mturk * SUCH DAMAGE.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ====================================================================
89565ae25f070411b0b32505b798195a9c98a1c2mturk * This software consists of voluntary contributions made by many
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * individuals on behalf of the Apache Software Foundation. For more
b97955fc7710323d2352a6c6f514fec02649e12dcovener * information on the Apache Software Foundation, please see
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * Portions of this software are based upon public domain software
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * originally written at the National Center for Supercomputing Applications,
6b9c9dc5117b48184a610fcea6f88a4704f63e5end * University of Illinois, Urbana-Champaign.
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh#include "http_protocol.h" /* For index_of_response(). Grump. */
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh#include "http_main.h" /* For the default_handler below... */
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh/* Make sure we don't write less than 4096 bytes at any one time.
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen/* Allow Apache to use ap_mmap */
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim/* mmap support for static files based on ideas from John Heidemann's
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim * patch against 1.0.5. See
b97955fc7710323d2352a6c6f514fec02649e12dcovener * <http://www.isi.edu/~johnh/SOFTWARE/APACHE/index.html>.
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* Files have to be at least this big before they're mmap()d. This is to deal
89565ae25f070411b0b32505b798195a9c98a1c2mturk * with systems where the expense of doing an mmap() and an munmap() outweighs
89565ae25f070411b0b32505b798195a9c98a1c2mturk * the benefit for small files. It shouldn't be set lower than 1.
89565ae25f070411b0b32505b798195a9c98a1c2mturk# endif /* SUNOS4 */
89565ae25f070411b0b32505b798195a9c98a1c2mturk#endif /* MMAP_THRESHOLD */
89565ae25f070411b0b32505b798195a9c98a1c2mturk#endif /* AP_USE_MMAP_FILES */
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* LimitXMLRequestBody handling */
f7f7fdc0557bf57f1b50982c88d422d743aa2f12humbedooh/* Server core module... This module provides support for really basic
89565ae25f070411b0b32505b798195a9c98a1c2mturk * server operations, including options and commands which control the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * operation of other modules. Consider this the bureaucracy module.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * The core module also defines handlers, etc., do handle just enough
89565ae25f070411b0b32505b798195a9c98a1c2mturk * to allow a server with the core module ONLY to actually serve documents
89565ae25f070411b0b32505b798195a9c98a1c2mturk * (though it slaps DefaultType on all of 'em); this was useful in testing,
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * but may not be worth preserving.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * This file could almost be mod_core.c, except for the stuff which affects
89565ae25f070411b0b32505b798195a9c98a1c2mturk * the http_conf_globals.
89565ae25f070411b0b32505b798195a9c98a1c2mturkstatic void *create_core_dir_config(apr_pool_t *a, char *dir)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)apr_pcalloc(a, sizeof(core_dir_config));
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->d_is_fnmatch = conf->d ? (apr_is_fnmatch(conf->d) != 0) : 0;
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd conf->d_components = conf->d ? ap_count_dirs(conf->d) : 0;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->do_rfc1413 = DEFAULT_RFC1413 | 2; /* set bit 1 to indicate default */
89565ae25f070411b0b32505b798195a9c98a1c2mturk#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->script_interpreter_source = INTERPRETER_SOURCE_UNSET;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->add_default_charset = ADD_DEFAULT_CHARSET_UNSET;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->output_filters = apr_make_array(a, 2, sizeof(void *));
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd conf->input_filters = apr_make_array(a, 2, sizeof(void *));
89565ae25f070411b0b32505b798195a9c98a1c2mturk return (void *)conf;
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231ndstatic void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)apr_palloc(a, sizeof(core_dir_config));
89565ae25f070411b0b32505b798195a9c98a1c2mturk memcpy((char *)conf, (const char *)base, sizeof(core_dir_config));
89565ae25f070411b0b32505b798195a9c98a1c2mturk memcpy(conf->response_code_strings, base->response_code_strings,
89565ae25f070411b0b32505b798195a9c98a1c2mturk sizeof(*conf->response_code_strings) * RESPONSE_CODES);
89565ae25f070411b0b32505b798195a9c98a1c2mturk /* there was no explicit setting of new->opts, so we merge
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * preserve the invariant (opts_add & opts_remove) == 0
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->opts_add = (conf->opts_add & ~new->opts_remove) | new->opts_add;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->opts_remove = (conf->opts_remove & ~new->opts_add)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->opts = (conf->opts & ~conf->opts_remove) | conf->opts_add;
89565ae25f070411b0b32505b798195a9c98a1c2mturk if ((base->opts & OPT_INCNOEXEC) && (new->opts & OPT_INCLUDES)) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->opts = (conf->opts & ~OPT_INCNOEXEC) | OPT_INCLUDES;
89565ae25f070411b0b32505b798195a9c98a1c2mturk /* otherwise we just copy, because an explicit opts setting
89565ae25f070411b0b32505b798195a9c98a1c2mturk * overrides all earlier +/- modifiers
89565ae25f070411b0b32505b798195a9c98a1c2mturk sizeof(*conf->response_code_strings) * RESPONSE_CODES);
89565ae25f070411b0b32505b798195a9c98a1c2mturk memcpy(conf->response_code_strings, new->response_code_strings,
89565ae25f070411b0b32505b798195a9c98a1c2mturk sizeof(*conf->response_code_strings) * RESPONSE_CODES);
89565ae25f070411b0b32505b798195a9c98a1c2mturk for (i = 0; i < RESPONSE_CODES; ++i) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk if (new->use_canonical_name != USE_CANONICAL_NAME_UNSET) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->sec = apr_append_arrays(a, base->sec, new->sec);
89565ae25f070411b0b32505b798195a9c98a1c2mturk if (new->script_interpreter_source != INTERPRETER_SOURCE_UNSET) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->script_interpreter_source = new->script_interpreter_source;
89565ae25f070411b0b32505b798195a9c98a1c2mturk if (new->add_default_charset != ADD_DEFAULT_CHARSET_UNSET) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->add_default_charset_name = new->add_default_charset_name;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->output_filters = apr_append_arrays(a, base->output_filters,
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->input_filters = apr_append_arrays(a, base->input_filters,
89565ae25f070411b0b32505b798195a9c98a1c2mturk return (void*)conf;
89565ae25f070411b0b32505b798195a9c98a1c2mturkstatic void *create_core_server_config(apr_pool_t *a, server_rec *s)
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_server_config *)apr_pcalloc(a, sizeof(core_server_config));
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->access_name = is_virtual ? NULL : DEFAULT_ACCESS_FNAME;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->ap_document_root = is_virtual ? NULL : DOCUMENT_LOCATION;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->sec_url = apr_make_array(a, 40, sizeof(void *));
89565ae25f070411b0b32505b798195a9c98a1c2mturk return (void *)conf;
89565ae25f070411b0b32505b798195a9c98a1c2mturkstatic void *merge_core_server_configs(apr_pool_t *p, void *basev, void *virtv)
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_server_config *base = (core_server_config *)basev;
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_server_config *virt = (core_server_config *)virtv;
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_server_config *)apr_pcalloc(p, sizeof(core_server_config));
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf->sec = apr_append_arrays(p, base->sec, virt->sec);
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd conf->sec_url = apr_append_arrays(p, base->sec_url, virt->sec_url);
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* Add per-directory configuration entry (for <directory> section);
89565ae25f070411b0b32505b798195a9c98a1c2mturk * these are part of the core server config.
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config)
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_server_config *sconf = ap_get_module_config(s->module_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk void **new_space = (void **)apr_push_array(sconf->sec);
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config)
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_server_config *sconf = ap_get_module_config(s->module_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk void **new_space = (void **)apr_push_array(sconf->sec_url);
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config)
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* core_reorder_directories reorders the directory sections such that the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 1-component sections come first, then the 2-component, and so on, finally
89565ae25f070411b0b32505b798195a9c98a1c2mturk * followed by the "special" sections. A section is "special" if it's a regex,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * or if it doesn't start with / -- consider proxy: matching. All movements
89565ae25f070411b0b32505b798195a9c98a1c2mturk * are in-order to preserve the ordering of the sections from the config files.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * See directory_walk().
89565ae25f070411b0b32505b798195a9c98a1c2mturk || ((entry_core)->d[0] != '/' && (entry_core)->d[1] != ':'))
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* XXX: Fairly certain this is correct... '/' must prefix the path
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * or else in the case xyz:/ or abc/xyz:/, '/' must follow the ':'.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * If there is no leading '/' or embedded ':/', then we are special.
89565ae25f070411b0b32505b798195a9c98a1c2mturk ((entry_core)->r != NULL || (entry_core)->d[0] != '/')
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* We need to do a stable sort, qsort isn't stable. So to make it stable
89565ae25f070411b0b32505b798195a9c98a1c2mturk * we'll be maintaining the original index into the list, and using it
89565ae25f070411b0b32505b798195a9c98a1c2mturk * as the minor key during sorting. The major key is the number of
89565ae25f070411b0b32505b798195a9c98a1c2mturk * components (where a "special" section has infinite components).
89565ae25f070411b0b32505b798195a9c98a1c2mturkstatic int reorder_sorter(const void *va, const void *vb)
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_a = (core_dir_config *)ap_get_module_config(a->elt, &core_module);
89565ae25f070411b0b32505b798195a9c98a1c2mturk core_b = (core_dir_config *)ap_get_module_config(b->elt, &core_module);
12eb0882b553ff0fe7637fccff3fd74da4f7ffd3rpluem /* we know they're both not special */
89565ae25f070411b0b32505b798195a9c98a1c2mturk else if (core_a->d_components > core_b->d_components) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk /* Either they're both special, or they're both not special and have the
12eb0882b553ff0fe7637fccff3fd74da4f7ffd3rpluem * same number of components. In any event, we now have to compare
89565ae25f070411b0b32505b798195a9c98a1c2mturk * the minor key. */
12eb0882b553ff0fe7637fccff3fd74da4f7ffd3rpluemvoid ap_core_reorder_directories(apr_pool_t *p, server_rec *s)
89565ae25f070411b0b32505b798195a9c98a1c2mturk sconf = ap_get_module_config(s->module_config, &core_module);
89565ae25f070411b0b32505b798195a9c98a1c2mturk /* we have to allocate tmp space to do a stable sort */
89565ae25f070411b0b32505b798195a9c98a1c2mturk sortbin = apr_palloc(tmp, sec->nelts * sizeof(*sortbin));
89565ae25f070411b0b32505b798195a9c98a1c2mturk for (i = 0; i < nelts; ++i) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk qsort(sortbin, nelts, sizeof(*sortbin), reorder_sorter);
89565ae25f070411b0b32505b798195a9c98a1c2mturk /* and now copy back to the original array */
89565ae25f070411b0b32505b798195a9c98a1c2mturk for (i = 0; i < nelts; ++i) {
89565ae25f070411b0b32505b798195a9c98a1c2mturk/*****************************************************************
89565ae25f070411b0b32505b798195a9c98a1c2mturk * There are some elements of the core config structures in which
89565ae25f070411b0b32505b798195a9c98a1c2mturk * other modules have a legitimate interest (this is ugly, but necessary
89565ae25f070411b0b32505b798195a9c98a1c2mturk * to preserve NCSA back-compatibility). So, we have a bunch of accessors
89565ae25f070411b0b32505b798195a9c98a1c2mturk (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_DECLARE(const char *) ap_default_type(request_rec *r)
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_server_config *)ap_get_module_config(r->server->module_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturkAP_DECLARE(const apr_array_header_t *) ap_requires(request_rec *r)
ab1ccbc6cd311935013f6e620b5103242147d688rjung conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* Should probably just get rid of this... the only code that cares is
89565ae25f070411b0b32505b798195a9c98a1c2mturk * part of the core anyway (and in fact, it isn't publicised to other
89565ae25f070411b0b32505b798195a9c98a1c2mturk * modules).
&core_module);
return NULL;
if (hptr) {
char **haddr;
int type)
int hostname_lookups;
if (dir_config) {
return NULL;
return NULL;
&core_module);
return NULL;
core_dir_config *d;
&core_module);
AF_INET);
unsigned port;
core_dir_config *d =
: port;
return port;
request_rec *r)
core_dir_config *d =
return d->limit_req_body;
#ifdef WIN32
char* relativepath,
char **value)
if (size) {
int size;
int result;
char *buffer;
if (!ext)
return NULL;
&hkeyType);
return NULL;
if (cmdOfName) {
if (cmdOfName)
return NULL;
++*arguments;
return buffer;
char** interpreter,
char** arguments)
core_dir_config *d;
&core_module);
if (!exename) {
if (!exename) {
exename++;
if (comspec) {
return eFileTypeSCRIPT;
return eFileTypeUNKNOWN;
if (*interpreter)
return eFileTypeSCRIPT;
return eFileTypeUNKNOWN;
return eFileTypeUNKNOWN;
return eFileTypeUNKNOWN;
return fileType;
* Commands... this module handles almost all of the NCSA httpd.conf
* commands, but most of the old srm.conf is in the the modules.
const char *what)
return dirp;
return NULL;
unsigned forbidden)
return NULL;
const char *arg)
return err;
return NULL;
#ifdef GPROF
return err;
return NULL;
return err;
return NULL;
const char *arg)
return err;
arg);
return NULL;
int idx;
return err;
* http_protocol.c relies on to distinguish between
return NULL;
return err;
return NULL;
char action;
action = *(w++);
else if (first) {
first = 0;
return NULL;
return NULL;
require_line *r;
if (!c->ap_requires) {
return NULL;
const char *arg) {
int limited = 0;
const char *errmsg;
return err;
while (limited_methods[0]) {
char **xmethod;
if (!tog) {
return errmsg;
#ifdef WIN32
#define USE_ICASE 0
const char *errmsg;
return err;
#if defined(HAVE_UNC_PATHS)
&core_module);
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
&core_module);
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
if (!old_path) {
&core_module);
return errmsg;
conf->r = r;
return NULL;
if (not) {
arg++;
const char *retval;
return retval;
char **defines;
const char *endp;
int not = 0;
arg++;
const char *retval;
return retval;
/* httpd.conf commands... beginning with the <VirtualHost> business */
const char *arg)
const char *errmsg;
return err;
if (errmsg) {
return errmsg;
s->lookup_defaults);
return errmsg;
const char *arg)
while (*arg) {
return NULL;
char **newfilter;
return NULL;
char **newfilter;
return NULL;
const char *arg)
return err;
return NULL;
return err;
return NULL;
const char *arg)
return err;
return NULL;
int port;
return err;
return NULL;
const char *arg)
return err;
return NULL;
const char *arg)
return err;
return NULL;
return err;
return NULL;
const char *arg)
return err;
return NULL;
const char *arg)
return err;
return NULL;
const char *arg)
return err;
return NULL;
return err;
return NULL;
const char *arg)
return err;
return NULL;
const char *arg)
return err;
return NULL;
return err;
return NULL;
const char *arg)
return err;
return NULL;
const char *name)
return NULL;
char *str;
return err;
return NULL;
&core_module);
const char *word1)
return NULL;
return err;
static int version_locked = 0;
enum server_token_type {
version_locked = 0;
return APR_SUCCESS;
if (! version_locked) {
const char *arg)
return err;
return NULL;
const char *arg)
int lim;
return err;
if (lim < 0) {
return NULL;
const char *arg)
int lim;
return err;
if (lim < 0) {
NULL);
return NULL;
const char *arg)
int lim;
return err;
if (lim < 0) {
NULL);
return NULL;
const char *arg)
return err;
* Instead we have an idiotic define in httpd.h that prevents
return NULL;
const char *arg)
return err;
return NULL;
return AP_DEFAULT_LIMIT_XML_BODY;
#ifdef WIN32
char *arg)
return NULL;
#if !defined (RLIMIT_CPU) || !(defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)) || !defined (RLIMIT_NPROC)
return NULL;
#ifdef RLIMIT_CPU
return NULL;
#if defined(RLIMIT_AS)
return NULL;
#ifdef RLIMIT_NPROC
return NULL;
apr_ssize_t i = 0;
*nbytes = 0;
bytes_written += n;
return rv;
if (n < cnt) {
return APR_SUCCESS;
apr_int32_t i;
*nbytes = 0;
sendlen = 0;
return rv;
#ifdef GPROF
#ifdef _OSD_POSIX
#ifdef WIN32
#ifdef RLIMIT_CPU
#ifdef RLIMIT_NPROC
{ NULL }
if (r->proxyreq) {
return HTTP_FORBIDDEN;
return HTTP_BAD_REQUEST;
NULL);
NULL);
return OK;
core_dir_config *d =
#ifdef AP_USE_MMAP_FILES
int bld_content_md5 =
return errstatus;
return HTTP_NOT_IMPLEMENTED;
return ap_send_http_options(r);
return HTTP_METHOD_NOT_ALLOWED;
: r->filename);
return HTTP_NOT_FOUND;
return HTTP_METHOD_NOT_ALLOWED;
return HTTP_FORBIDDEN;
ap_set_etag(r);
return errstatus;
#ifdef AP_USE_MMAP_FILES
if (bld_content_md5) {
if (!r->header_only) {
if (!rangestatus) {
return HTTP_INTERNAL_SERVER_ERROR;
#ifdef AP_USE_MMAP_FILES
unsigned char *addr;
if (bld_content_md5) {
if (!r->header_only) {
if (!rangestatus) {
return OK;
typedef struct COALESCE_FILTER_CTX {
AP_BRIGADE_FOREACH(e, b) {
if (destroy_me) {
const char *str;
apr_ssize_t n;
return rv;
AP_BUCKET_REMOVE(e);
destroy_me = e;
insert_before = e;
if (destroy_me) {
if (pass_the_brigade) {
if (insert_first) {
AP_BRIGADE_INSERT_HEAD(b, e);
else if (insert_before) {
return rv;
if (ctx) {
if (insert_before) {
return APR_SUCCESS;
ap_bucket *e;
AP_BRIGADE_FOREACH(e, b) {
if (AP_BUCKET_IS_EOS(e)) {
eos = e;
const char *data;
return rv;
if (len > 0) {
if (bytes > 0) {
#ifdef CHARSET_EBCDIC
AP_BRIGADE_INSERT_HEAD(b, e);
AP_BRIGADE_INSERT_TAIL(b, e);
return rv;
return APR_SUCCESS;
ap_bucket *e;
AP_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
return APR_EOF;
typedef struct CORE_OUTPUT_FILTER_CTX {
ap_bucket *e;
conn_rec *c = f->c;
if (ctx->b) {
b = ctx->b;
AP_BRIGADE_INSERT_HEAD(b, e);
AP_BRIGADE_FOREACH(e, b) {
if (AP_BUCKET_IS_EOS(e)) {
else if (AP_BUCKET_IS_FILE(e)) {
const char *str;
apr_ssize_t n;
nbytes += n;
if (!fd) {
nvec++;
if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && !AP_BUCKET_IS_EOS(e) && !AP_BUCKET_IS_FLUSH(e)) {
return APR_SUCCESS;
if (fd) {
#if APR_HAS_SENDFILE
if (nvec) {
if (nvec_trailers) {
#if APR_HAS_SENDFILE
if (!c->keepalive) {
&nbytes,
flags);
#if APR_HAS_SENDFILE
if (more)
return rv;
nvec = 0;
nvec_trailers = 0;
b = more;
return APR_SUCCESS;
{ return DEFAULT_HTTP_PORT; }
&core_module);
static void register_hooks(void)