core.c revision 9a806b671337b22acf6418e60a83f6bbeabdf771
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny/* ====================================================================
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * The Apache Software License, Version 1.1
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Redistribution and use in source and binary forms, with or without
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * modification, are permitted provided that the following conditions
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 1. Redistributions of source code must retain the above copyright
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * notice, this list of conditions and the following disclaimer.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 2. Redistributions in binary form must reproduce the above copyright
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * notice, this list of conditions and the following disclaimer in
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * the documentation and/or other materials provided with the
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * distribution.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 3. The end-user documentation included with the redistribution,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * if any, must include the following acknowledgment:
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * "This product includes software developed by the
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Apache Software Foundation (http://www.apache.org/)."
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Alternately, this acknowledgment may appear in the software itself,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * if and wherever such third-party acknowledgments normally appear.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * 4. The names "Apache" and "Apache Software Foundation" must
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * not be used to endorse or promote products derived from this
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * software without prior written permission. For written
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * permission, please contact apache@apache.org.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * 5. Products derived from this software may not be called "Apache",
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * nor may "Apache" appear in their name, without prior written
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * permission of the Apache Software Foundation.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * SUCH DAMAGE.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ====================================================================
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * This software consists of voluntary contributions made by many
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * individuals on behalf of the Apache Software Foundation. For more
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * information on the Apache Software Foundation, please see
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * Portions of this software are based upon public domain software
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * originally written at the National Center for Supercomputing Applications,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * University of Illinois, Urbana-Champaign.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#include "apr_thread_proc.h" /* for RLIMIT stuff */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#include "http_protocol.h" /* For index_of_response(). Grump. */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#include "http_main.h" /* For the default_handler below... */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* LimitXMLRequestBody handling */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#define AP_DEFAULT_LIMIT_XML_BODY ((size_t)1000000)
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek (apr_pool_t *p, const char *val, apr_hash_t *ht),
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Server core module... This module provides support for really basic
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * server operations, including options and commands which control the
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * operation of other modules. Consider this the bureaucracy module.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * The core module also defines handlers, etc., do handle just enough
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek * to allow a server with the core module ONLY to actually serve documents
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek * (though it slaps DefaultType on all of 'em); this was useful in testing,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * but may not be worth preserving.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * This file could almost be mod_core.c, except for the stuff which affects
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * the http_conf_globals.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Handles for core filters */
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekAP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekAP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekAP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekAP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle;
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekAP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozekstatic void *create_core_dir_config(apr_pool_t *a, char *dir)
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf = (core_dir_config *)apr_pcalloc(a, sizeof(core_dir_config));
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek /* conf->r and conf->d[_*] are initialized by dirsection() or left NULL */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf->opts = dir ? OPT_UNSET : OPT_UNSET|OPT_ALL;
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf->override = dir ? OR_UNSET : OR_UNSET|OR_ALL;
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf->use_canonical_name = USE_CANONICAL_NAME_UNSET;
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf->hostname_lookups = HOSTNAME_LOOKUP_UNSET;
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek conf->do_rfc1413 = DEFAULT_RFC1413 | 2; /* set bit 1 to indicate default */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek conf->sec_file = apr_array_make(a, 2, sizeof(ap_conf_vector_t *));
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek conf->add_default_charset = ADD_DEFAULT_CHARSET_UNSET;
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek conf->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek /* Overriding all negotiation
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek * Flag for use of inodes in ETags.
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek return (void *)conf;
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek * Overlay one hash table of ct_output_filters onto another
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek const void *key,
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek const ap_filter_rec_t *overlay_info = (const ap_filter_rec_t *)overlay_val;
877b92e80bde510d5cd9f03dbf01e2bcf73ab072Michal Židek const ap_filter_rec_t *base_info = (const ap_filter_rec_t *)base_val;
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek new->name = apr_pstrdup(p, overlay_info->name);
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek /* We can't have dups. */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystatic void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv)
9822d4d468ec74e4e173f5adf0db12d02974cd18Sumit Bose core_dir_config *base = (core_dir_config *)basev;
a6cca9c284724fafd670a3163812f248ba53ad97Jakub Hrozek /* Create this conf by duplicating the base, replacing elements
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * (or creating copies for merging) where new-> values exist.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny conf = (core_dir_config *)apr_palloc(a, sizeof(core_dir_config));
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* there was no explicit setting of new->opts, so we merge
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * preserve the invariant (opts_add & opts_remove) == 0
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny conf->opts_add = (conf->opts_add & ~new->opts_remove) | new->opts_add;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny conf->opts_remove = (conf->opts_remove & ~new->opts_add)
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny conf->opts = (conf->opts & ~conf->opts_remove) | conf->opts_add;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if ((base->opts & OPT_INCNOEXEC) && (new->opts & OPT_INCLUDES)) {
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny conf->opts = (conf->opts & ~OPT_INCNOEXEC) | OPT_INCLUDES;
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce /* otherwise we just copy, because an explicit opts setting
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek * overrides all earlier +/- modifiers
9822d4d468ec74e4e173f5adf0db12d02974cd18Sumit Bose conf->response_code_strings = new->response_code_strings;
a6cca9c284724fafd670a3163812f248ba53ad97Jakub Hrozek /* If we merge, the merge-result must have it's own array
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose sizeof(*conf->response_code_strings) * RESPONSE_CODES);
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose memcpy(conf->response_code_strings, base->response_code_strings,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose sizeof(*conf->response_code_strings) * RESPONSE_CODES);
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek for (i = 0; i < RESPONSE_CODES; ++i) {
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek conf->response_code_strings[i] = new->response_code_strings[i];
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek /* Otherwise we simply use the base->response_code_strings array
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce if (new->hostname_lookups != HOSTNAME_LOOKUP_UNSET) {
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov conf->accept_path_info = new->accept_path_info;
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce if (new->use_canonical_name != USE_CANONICAL_NAME_UNSET) {
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce conf->use_canonical_name = new->use_canonical_name;
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose /* If we merge, the merge-result must have it's own array
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose conf->sec_file = apr_array_append(a, base->sec_file, new->sec_file);
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov /* Otherwise we simply use the base->sec_file array
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose if (new->add_default_charset != ADD_DEFAULT_CHARSET_UNSET) {
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose conf->add_default_charset = new->add_default_charset;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose conf->add_default_charset_name = new->add_default_charset_name;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* Overriding all negotiation
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose if (conf->ct_output_filters && new->ct_output_filters) {
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek conf->ct_output_filters = apr_hash_copy(a, new->ct_output_filters);
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce /* That memcpy above isn't enough. */
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce conf->ct_output_filters = apr_hash_copy(a, base->ct_output_filters);
a6cca9c284724fafd670a3163812f248ba53ad97Jakub Hrozek * Now merge the setting of the FileETag directive.
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce (conf->etag_add & (~ new->etag_remove)) | new->etag_add;
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce (conf->opts_remove & (~ new->etag_add)) | new->etag_remove;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny (conf->etag_bits & (~ conf->etag_remove)) | conf->etag_add;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny return (void*)conf;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenystatic void *create_core_server_config(apr_pool_t *a, server_rec *s)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_server_config *)apr_pcalloc(a, sizeof(core_server_config));
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf->access_name = is_virtual ? NULL : DEFAULT_ACCESS_FNAME;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf->ap_document_root = is_virtual ? NULL : DOCUMENT_LOCATION;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce conf->sec_dir = apr_array_make(a, 40, sizeof(ap_conf_vector_t *));
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce conf->sec_url = apr_array_make(a, 40, sizeof(ap_conf_vector_t *));
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny return (void *)conf;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorcestatic void *merge_core_server_configs(apr_pool_t *p, void *basev, void *virtv)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny core_server_config *base = (core_server_config *)basev;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny core_server_config *virt = (core_server_config *)virtv;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_server_config *)apr_palloc(p, sizeof(core_server_config));
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov conf->ap_document_root = base->ap_document_root;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf->sec_dir = apr_array_append(p, base->sec_dir, virt->sec_dir);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf->sec_url = apr_array_append(p, base->sec_url, virt->sec_url);
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce/* Add per-directory configuration entry (for <directory> section);
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * these are part of the core server config.
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorceAP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config)
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce core_server_config *sconf = ap_get_module_config(s->module_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny void **new_space = (void **)apr_array_push(sconf->sec_dir);
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo SorceAP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config)
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce core_server_config *sconf = ap_get_module_config(s->module_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny void **new_space = (void **)apr_array_push(sconf->sec_url);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config)
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce void **new_space = (void **)apr_array_push(conf->sec_file);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny/* We need to do a stable sort, qsort isn't stable. So to make it stable
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * we'll be maintaining the original index into the list, and using it
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * as the minor key during sorting. The major key is the number of
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * components (where the root component is zero).
17195241500e46272018d7897d6e87249870caf2Pavel Reichlstatic int reorder_sorter(const void *va, const void *vb)
17195241500e46272018d7897d6e87249870caf2Pavel Reichl core_a = ap_get_module_config(a->elt, &core_module);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose core_b = ap_get_module_config(b->elt, &core_module);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* a regex always sorts after a non-regex
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* we always sort next by the number of components
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose if (core_a->d_components < core_b->d_components) {
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose else if (core_a->d_components > core_b->d_components) {
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* They have the same number of components, we now have to compare
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * the minor key to maintain the original order (from the config.)
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bosevoid ap_core_reorder_directories(apr_pool_t *p, server_rec *s)
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose sconf = ap_get_module_config(s->module_config, &core_module);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* simple case of already being sorted... */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* We're not checking this condition to be fast... we're checking
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * it to avoid trying to palloc zero bytes, which can trigger some
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * memory debuggers to barf
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* we have to allocate tmp space to do a stable sort */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose sortbin = apr_palloc(tmp, sec_dir->nelts * sizeof(*sortbin));
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose for (i = 0; i < nelts; ++i) {
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose qsort(sortbin, nelts, sizeof(*sortbin), reorder_sorter);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* and now copy back to the original array */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose for (i = 0; i < nelts; ++i) {
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose/*****************************************************************
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * There are some elements of the core config structures in which
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * other modules have a legitimate interest (this is ugly, but necessary
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * to preserve NCSA back-compatibility). So, we have a bunch of accessors
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit BoseAP_DECLARE(int) ap_allow_overrides(request_rec *r)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
9af86b9c936d07cff9d0c2054acde908749ea522Jakub HrozekAP_DECLARE(const char *) ap_auth_type(request_rec *r)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAP_DECLARE(const char *) ap_auth_name(request_rec *r)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
0754ff886f909f0404038eb9c99dd61be1acf5b9Simo SorceAP_DECLARE(const char *) ap_default_type(request_rec *r)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAP_DECLARE(const char *) ap_document_root(request_rec *r) /* Don't use this! */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_server_config *)ap_get_module_config(r->server->module_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAP_DECLARE(const apr_array_header_t *) ap_requires(request_rec *r)
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
17195241500e46272018d7897d6e87249870caf2Pavel Reichl/* Should probably just get rid of this... the only code that cares is
17195241500e46272018d7897d6e87249870caf2Pavel Reichl * part of the core anyway (and in fact, it isn't publicised to other
17195241500e46272018d7897d6e87249870caf2Pavel Reichlchar *ap_response_code_string(request_rec *r, int error_index)
17195241500e46272018d7897d6e87249870caf2Pavel Reichl conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
17195241500e46272018d7897d6e87249870caf2Pavel Reichl return conf->response_code_strings[error_index];
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek/* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozekstatic APR_INLINE void do_double_reverse (conn_rec *conn)
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* already done */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek if (conn->remote_host == NULL || conn->remote_host[0] == '\0') {
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* single reverse failed, so don't bother */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny rv = apr_sockaddr_info_get(&sa, conn->remote_host, APR_UNSPEC, 0, 0, conn->pool);
3b0e0352d8076909608d04750d3ea6b0d9ba33f6Jakub HrozekAP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* If we haven't checked the host name, and we want to */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce ((core_dir_config *)ap_get_module_config(dir_config, &core_module))
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek if (hostname_lookups == HOSTNAME_LOOKUP_UNSET) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* the default */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce if (apr_getnameinfo(&conn->remote_host, conn->remote_addr, 0)
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce if (hostname_lookups == HOSTNAME_LOOKUP_DOUBLE) {
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* if failed, set it to the NULL string to indicate error */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * Return the desired information; either the remote DNS name, if found,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * or either NULL (if the hostname was requested) or the IP address
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * (if any identifier was requested).
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if (conn->remote_host != NULL && conn->remote_host[0] != '\0') {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce if (type == REMOTE_HOST || type == REMOTE_DOUBLE_REV) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo SorceAP_DECLARE(const char *) ap_get_remote_logname(request_rec *r)
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* If we haven't checked the identity, and we want to */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce dir_conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce/* There are two options regarding what the "name" of a server is. The
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * "canonical" name as defined by ServerName and Port, or the "client's
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * name" as supplied by a possible Host: header or full URI. We never
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * trust the port passed in the client's headers, we always use the
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * port of the actual socket.
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * The DNS option to UseCanonicalName causes this routine to do a
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * reverse lookup on the local IP address of the connection and use
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * that for the ServerName. This makes its value more reliable while
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * at the same time allowing Demon's magic virtual hosting to work.
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * The assumption is that DNS lookups are sufficiently quick...
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * -- fanf 1998-10-03
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit BoseAP_DECLARE(const char *) ap_get_server_name(request_rec *r)
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek if (d->use_canonical_name == USE_CANONICAL_NAME_OFF) {
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek return r->hostname ? r->hostname : r->server->server_hostname;
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek if (d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* default */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo SorceAP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r)
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce || d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* With UseCanonicalName off Apache will form self-referential
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * URLs using the hostname and port supplied by the client if
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * any are supplied (otherwise it will use the canonical name).
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce else { /* d->use_canonical_name == USE_CANONICAL_NAME_ON */
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce /* With UseCanonicalName on (and in all versions prior to 1.3)
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * Apache will use the hostname and port specified in the
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * ServerName directive to construct a canonical name for the
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * server. (If no port was specified in the ServerName
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * directive, Apache uses the port supplied by the client if
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * any is supplied, and finally the default port for the protocol
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce r->connection->local_addr->port ? r->connection->local_addr->port :
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* default */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo SorceAP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce return apr_pstrcat(p, ap_http_method(r), "://", host, uri, NULL);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny return apr_psprintf(p, "%s://%s:%u%s", ap_http_method(r), host, port, uri);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan ZelenyAP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r)
c03b28a38b14fdb59f74864ae4dc56affe256508Simo Sorce (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose/*****************************************************************
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * Commands... this module handles almost all of the NCSA httpd.conf
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose * commands, but most of the old srm.conf is in the the modules.
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose/* returns a parent if it matches the given directive */
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bosestatic const ap_directive_t * find_parent(const ap_directive_t *dirp,
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose const char *what)
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek /* ### it would be nice to have atom-ized directives */
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub HrozekAP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd,
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek && cmd->cmd->name[strlen(cmd->cmd->name)-1] != '>')
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose if ((forbidden & NOT_IN_VIRTUALHOST) && cmd->server->is_virtual) {
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose " cannot occur within <VirtualHost> section", NULL);
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose if ((forbidden & NOT_IN_LIMIT) && cmd->limited != -1) {
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose " cannot occur within <Directory/Location/Files> "
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* EXEC_ON_READ must be NOT_IN_DIR_LOC_FILE, if not, it will
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * (deliberately) segfault below in the individual tests...
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek && ((found = find_parent(cmd->directive, "<Directory"))
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek || (found = find_parent(cmd->directive, "<DirectoryMatch"))))
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek && ((found = find_parent(cmd->directive, "<Location"))
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek || (found = find_parent(cmd->directive, "<LocationMatch"))))
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny && ((found = find_parent(cmd->directive, "<Files"))
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov || (found = find_parent(cmd->directive, "<FilesMatch"))))) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov " cannot occur within ", found->directive,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystatic const char *set_access_name(cmd_parms *cmd, void *dummy,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny const char *arg)
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny core_server_config *conf = ap_get_module_config(sconf, &core_module);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystatic const char *set_gprof_dir(cmd_parms *cmd, void *dummy, const char *arg)
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce core_server_config *conf = ap_get_module_config(sconf, &core_module);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#endif /*GPROF*/
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystatic const char *set_add_default_charset(cmd_parms *cmd,
return err;
return NULL;
const char *arg)
return err;
arg);
return NULL;
const char *string)
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;
const char *args_p)
char action;
char *token;
const char *args;
int valid;
int first;
int explicit;
explicit = 0;
token++;
if (first) {
first = 0;
valid = 0;
valid = 0;
if (! valid) {
NULL);
if (explicit) {
return NULL;
const char *arg)
return err;
return NULL;
return NULL;
require_line *r;
if (!c->ap_requires) {
return NULL;
void *dummy,
const char *arg)
const char *errmsg;
return err;
while (limited_methods[0]) {
int methnum;
return errmsg;
#ifdef WIN32
#define USE_ICASE 0
const char *errmsg;
return err;
if (!arg) {
char *newpath;
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
if (!old_path) {
char *newpath;
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;
const char *arg)
return err;
return NULL;
const char *portstr;
int port;
return err;
if (portstr) {
portstr++;
port = 0;
return NULL;
const char *arg)
return err;
return NULL;
const char *arg)
return err;
return NULL;
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;
return NULL;
const char *arg)
return err;
return NULL;
const char *name)
if (!conffile) {
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)
char *errp;
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;
#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;
if (old) {
return NULL;
&core_module);
while (ct_filter) {
*nbytes = 0;
bytes_written += n;
return rv;
*nbytes += n;
if (n < cnt) {
return APR_SUCCESS;
#if APR_HAS_SENDFILE
#ifdef AP_DEBUG
flags);
tmplen = 0;
file_bytes_left = 0;
file_offset = 0;
tmplen = 0;
apr_int32_t i;
*nbytes = 0;
sendlen = 0;
return rv;
#ifdef GPROF
"Set to on or off for PATH_INFO to be accepted by handlers, or default for the per-handler preference"),
#ifdef _OSD_POSIX
#ifdef RLIMIT_CPU
#ifdef RLIMIT_NPROC
* #defined them in mpm.h.
#ifdef AP_MPM_WANT_SET_PIDFILE
#ifdef AP_MPM_WANT_SET_SCOREBOARD
#ifdef AP_MPM_WANT_SET_LOCKFILE
#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
#ifdef AP_MPM_WANT_SET_COREDUMPDIR
#ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
{ NULL }
if (r->proxyreq) {
return HTTP_FORBIDDEN;
return HTTP_BAD_REQUEST;
!= APR_SUCCESS) {
return HTTP_FORBIDDEN;
!= APR_SUCCESS) {
return HTTP_FORBIDDEN;
return OK;
int access_status;
return access_status;
return access_status;
return OK;
&core_module);
return OK;
apr_bucket *e;
core_dir_config *d;
int errstatus;
int bld_content_md5;
&core_module);
return errstatus;
return HTTP_NOT_FOUND;
return HTTP_NOT_FOUND;
return HTTP_NOT_FOUND;
return HTTP_FORBIDDEN;
ap_set_etag(r);
return errstatus;
if (bld_content_md5) {
c->bucket_alloc);
#if APR_HAS_MMAP
(void)apr_bucket_file_enable_mmap(e, 0);
return HTTP_NOT_IMPLEMENTED;
return ap_send_http_options(r);
return HTTP_METHOD_NOT_ALLOWED;
if (!f->ctx) {
if (*first_line) {
(int)(keptalive
*first_line = 0;
if (keptalive) {
#define BRIGADE_NORMALIZE(b) \
apr_bucket *d; \
d = APR_BUCKET_NEXT(e); \
apr_bucket_delete(e); \
e = APR_BUCKET_NEXT(e); \
apr_bucket *e;
const char *str;
return APR_SUCCESS;
if (!ctx)
return APR_EOF;
return APR_EOF;
apr_bucket *e;
return APR_EOF;
return rv;
c = str;
if (*c == APR_ASCII_LF)
return APR_SUCCESS;
apr_bucket *e;
APR_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
apr_bucket *e;
return APR_SUCCESS;
return rv;
APR_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
return rv;
return rv;
return APR_SUCCESS;
return rv;
conn_rec *c = f->c;
if (ctx->b) {
b = ctx->b;
while (b && !APR_BRIGADE_EMPTY(b)) {
apr_bucket *e;
APR_BRIGADE_FOREACH(e, b) {
last_e = e;
if (APR_BUCKET_IS_EOS(e)) {
if (APR_BUCKET_IS_FLUSH(e)) {
else if (APR_BUCKET_IS_FILE(e)
if (fd) {
const char *str;
apr_size_t n;
if (!fd) {
if (last_merged_bucket) {
temp_brig = b;
b = bb;
f->c->bucket_alloc);
while (temp != e) {
apr_bucket *d;
d = temp;
nvec = 0;
nbytes = 0;
nvec++;
nvec++;
e = temp;
last_e = e;
nvec++;
nbytes += n;
const char *str;
apr_size_t n;
return HTTP_INTERNAL_SERVER_ERROR;
return APR_SUCCESS;
if (fd) {
#if APR_HAS_SENDFILE
if (nvec) {
if (nvec_trailers) {
#if APR_HAS_SENDFILE
if (more)
return APR_SUCCESS;
b = more;
return APR_SUCCESS;
return OK;
return OK;
&core_module);
if (filters) {
if (filters) {
return APR_SUCCESS;
return num_request_notes++;
return NULL;
if (!req_cfg) {
return NULL;
sizeof(void *) * num_request_notes);
if (r->main) {
if (!r->prev) {
return OK;
!= APR_SUCCESS) {
return NULL;
!= APR_SUCCESS) {
return NULL;
net->c = c;
return DONE;