core.c revision bd3f5647b96d378d9c75c954e3f13582af32c643
3802a3d3d7af51ddff31943d5514382f01265770Lennart Poettering/* Licensed to the Apache Software Foundation (ASF) under one or more
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen * contributor license agreements. See the NOTICE file distributed with
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * this work for additional information regarding copyright ownership.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * The ASF licenses this file to You under the Apache License, Version 2.0
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * (the "License"); you may not use this file except in compliance with
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * the License. You may obtain a copy of the License at
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * http://www.apache.org/licenses/LICENSE-2.0
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * Unless required by applicable law or agreed to in writing, software
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * distributed under the License is distributed on an "AS IS" BASIS,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * See the License for the specific language governing permissions and
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * limitations under the License.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#include "apr_thread_proc.h" /* for RLIMIT stuff */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#include "http_protocol.h" /* For index_of_response(). Grump. */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#include "http_main.h" /* For the default_handler below... */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#include "mod_so.h" /* for ap_find_loaded_module_symbol */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#if defined(RLIMIT_CPU) || defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) || defined (RLIMIT_NPROC)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* LimitRequestBody handling */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* LimitXMLRequestBody handling */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_LIMIT_UNSET ((long) -1)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_DEFAULT_LIMIT_XML_BODY ((apr_size_t)1000000)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_MIN_SENDFILE_BYTES (256)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* maximum include nesting level */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_MAX_INCLUDE_DEPTH (128)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* valid in core-conf, but not in runtime r->used_path_info */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define AP_ACCEPT_PATHINFO_UNSET 3
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek APR_HOOK_LINK(insert_network_bucket)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_IMPLEMENT_HOOK_RUN_ALL(int, get_mgmt_items,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek (apr_pool_t *p, const char *val, apr_hash_t *ht),
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, insert_network_bucket,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek (conn_rec *c, apr_bucket_brigade *bb,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* Server core module... This module provides support for really basic
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * server operations, including options and commands which control the
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * operation of other modules. Consider this the bureaucracy module.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * The core module also defines handlers, etc., to handle just enough
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * to allow a server with the core module ONLY to actually serve documents.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * This file could almost be mod_core.c, except for the stuff which affects
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * the http_conf_globals.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* we know core's module_index is 0 */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* Handles for core filters */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* Provide ap_document_root_check storage and default value = true */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA int ap_document_root_check = 1;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* magic pointer for ErrorDocument xxx "default" */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmekstatic char errordocument_default;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmekstatic apr_array_header_t *saved_server_config_defines = NULL;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmekstatic apr_table_t *server_config_defined_vars = NULL;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA int ap_main_state = AP_SQ_MS_INITIAL_STARTUP;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-SzmekAP_DECLARE_DATA int ap_config_generation = 0;
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmekstatic void *create_core_dir_config(apr_pool_t *a, char *dir)
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek conf = (core_dir_config *)apr_pcalloc(a, sizeof(core_dir_config));
9407bc2d03b6405754807b6f38c8ca95b4fc1f40Zbigniew Jędrzejewski-Szmek /* conf->r and conf->d[_*] are initialized by dirsection() or left NULL */
9407bc2d03b6405754807b6f38c8ca95b4fc1f40Zbigniew Jędrzejewski-Szmek conf->opts = dir ? OPT_UNSET : OPT_UNSET|OPT_SYM_LINKS;
a8eaaee72a2f06e0fb64fb71de3b71ecba31dafbJan Engelhardt conf->opts_add = conf->opts_remove = OPT_NONE;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->override_opts = OPT_UNSET | OPT_ALL | OPT_SYM_OWNER | OPT_MULTI;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->content_md5 = AP_CONTENT_MD5_UNSET;
9407bc2d03b6405754807b6f38c8ca95b4fc1f40Zbigniew Jędrzejewski-Szmek conf->accept_path_info = AP_ACCEPT_PATHINFO_UNSET;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->use_canonical_name = USE_CANONICAL_NAME_UNSET;
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek conf->use_canonical_phys_port = USE_CANONICAL_PHYS_PORT_UNSET;
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek conf->hostname_lookups = HOSTNAME_LOOKUP_UNSET;
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * left as NULL (we use apr_pcalloc):
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * conf->limit_cpu = NULL;
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * conf->limit_mem = NULL;
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * conf->limit_nproc = NULL;
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * conf->sec_file = NULL;
9407bc2d03b6405754807b6f38c8ca95b4fc1f40Zbigniew Jędrzejewski-Szmek * conf->sec_if = NULL;
a8eaaee72a2f06e0fb64fb71de3b71ecba31dafbJan Engelhardt conf->limit_req_body = AP_LIMIT_REQ_BODY_UNSET;
9407bc2d03b6405754807b6f38c8ca95b4fc1f40Zbigniew Jędrzejewski-Szmek conf->limit_xml_body = AP_LIMIT_UNSET;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->server_signature = srv_sig_unset;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->add_default_charset = ADD_DEFAULT_CHARSET_UNSET;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek conf->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /* Overriding all negotiation
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * Set NULL by apr_pcalloc:
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * conf->mime_type = NULL;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * conf->handler = NULL;
3ba3a79df4ae094d1008c04a9af8d1ff970124c4Zbigniew Jędrzejewski-Szmek * conf->output_filters = NULL;
3ba3a79df4ae094d1008c04a9af8d1ff970124c4Zbigniew Jędrzejewski-Szmek * conf->input_filters = NULL;
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Flag for use of inodes in ETags.
return (void *)conf;
== OPT_INCLUDES)) {
for (i = 0; i < RESPONSE_CODES; ++i) {
#ifdef RLIMIT_CPU
#ifdef RLIMIT_NPROC
conf->max_overlaps = new->max_overlaps != AP_MAXRANGES_UNSET ? new->max_overlaps : base->max_overlaps;
conf->max_reversals = new->max_reversals != AP_MAXRANGES_UNSET ? new->max_reversals : base->max_reversals;
return (void*)conf;
#ifndef ACCEPT_FILTER_NAME
#ifdef __FreeBSD_version
if (!is_virtual) {
return (void *)conf;
return conf;
void *url_config)
void **new_space;
void *if_config)
void **new_space;
int have_if = 0;
ap_conf_vector_t *);
if (!have_if)
return NULL;
struct reorder_sort_rec {
int orig_index;
int nelts;
if (!nelts) {
for (i = 0; i < nelts; ++i) {
for (i = 0; i < nelts; ++i) {
if (authn_ap_auth_type) {
return authn_ap_auth_type(r);
return NULL;
if (authn_ap_auth_name) {
return authn_ap_auth_name(r);
return NULL;
access control interacts with authentication/authorization
if (access_compat_ap_satisfies) {
return access_compat_ap_satisfies(r);
return SATISFY_NOSPEC;
return ap_document_root(r);
const char *context_document_root)
if (context_prefix)
return NULL;
return NULL;
while (sa) {
int hostname_lookups;
int ignored_str_is_ip;
*str_is_ip = 0;
if (dir_config) {
== APR_SUCCESS) {
return NULL;
return NULL;
if (ident_lookup) {
return ident_lookup(r);
return NULL;
core_dir_config *d;
const char *retval;
switch (d->use_canonical_name) {
case USE_CANONICAL_NAME_ON:
case USE_CANONICAL_NAME_DNS:
case USE_CANONICAL_NAME_OFF:
case USE_CANONICAL_NAME_UNSET:
return retval;
#if APR_HAVE_IPV6
return plain_server_name;
core_dir_config *d =
switch (d->use_canonical_name) {
case USE_CANONICAL_NAME_OFF:
case USE_CANONICAL_NAME_DNS:
case USE_CANONICAL_NAME_UNSET:
ap_default_port(r);
ap_default_port(r);
case USE_CANONICAL_NAME_ON:
ap_default_port(r);
ap_default_port(r);
return port;
request_rec *r)
core_dir_config *d =
return AP_DEFAULT_LIMIT_REQ_BODY;
return d->limit_req_body;
* 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;
return NULL;
const char *arg)
return err;
return NULL;
struct sll {
const char *string;
const char *s, *e, *ep;
unsigned spc;
return word;
spc = 0;
if (!word)
if (word) {
name);
++outlen;
word = s;
} while (result);
return res_buf;
return OK;
if (err)
return err;
if (value) {
return NULL;
const char *name)
char **defines;
if (err)
return err;
if (server_config_defined_vars) {
return NULL;
const char *arg)
char * msg;
#ifdef GPROF
return err;
return NULL;
return NULL;
const char *arg)
return err;
if (!ap_document_root_check) {
return NULL;
arg);
return NULL;
const char *string)
int idx;
* http_protocol.c relies on to distinguish between
return NULL;
char *tok_state;
if (first) {
p = NULL;
first = 0;
return NULL;
const char *err;
return err;
return NULL;
const char *err;
return err;
for (i=0;i<argc;i++){
return NULL;
return NULL;
int merge = 0;
int all_none = 0;
char action;
action = *(w++);
else if (first) {
else if (merge) {
if (!first) {
if (!first) {
first = 0;
return NULL;
const char *arg)
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 NULL;
const char *arg)
return NULL;
void *dummy,
const char *arg)
const char *limited_methods;
const char *errmsg;
if (!limited_methods[0]) {
while (limited_methods[0]) {
int methnum;
NULL);
return errmsg;
#ifdef WIN32
#define USE_ICASE 0
const char *errmsg;
return err;
if (!arg[0]) {
char *newpath;
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
if (!arg[0]) {
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
return err;
if (!arg[0]) {
if (!old_path) {
char *newpath;
return errmsg;
conf->r = r;
return NULL;
const char *errmsg;
const char *condition;
const char *expr_err;
return err;
if (!old_path) {
ap_assert(0);
if (arg[0])
if (!arg[0])
if (expr_err)
expr_err);
return errmsg;
return errmsg;
return NULL;
if (!found) {
if (!found) {
if (check_symbol) {
return found;
if (not) {
arg++;
if (!arg[0]) {
const char *retval;
return retval;
char **defines;
const char *endp;
int not = 0;
arg++;
if (!arg[0]) {
const char *retval;
return retval;
/* httpd.conf commands... beginning with the <VirtualHost> business */
const char *arg)
const char *errmsg;
return err;
if (!arg[0]) {
if (errmsg) {
return errmsg;
s->lookup_defaults);
return errmsg;
const char *arg)
while (*arg) {
return NULL;
char* proto;
char* accf;
return err;
return NULL;
const char *arg)
char* proto;
return err;
return NULL;
const char *arg)
return err;
return NULL;
* ServerName www.example.com
* ServerName www.example.com:80
* ServerName https://www.example.com:443
char *scheme;
int port;
return err;
if (part) {
if (portstr) {
portstr++;
port = 0;
return NULL;
const char *arg)
return NULL;
const char *arg)
return err;
return NULL;
return err;
return NULL;
return err;
return NULL;
d->allow_encoded_slashes = 0;
d->decode_encoded_slashes = 0;
d->decode_encoded_slashes = 0;
NULL);
return NULL;
const char *arg)
return NULL;
const char *arg)
return err;
return NULL;
return NULL;
return NULL;
const char *arg)
return NULL;
const char *arg)
return NULL;
const char *name)
unsigned *recursion;
void *data;
if (data) {
*recursion = 0;
*recursion = 0;
if (!conffile) {
*recursion = 0;
optional);
if (error) {
*recursion = 0;
return error;
if (*recursion) {
--*recursion;
return NULL;
const char *arg)
int level;
return err;
return NULL;
level_str++;
if (!*level_str) {
return NULL;
char *const argv[])
int ret, i;
if (mask) {
mask++;
return err;
return NULL;
static int banner_locked = 0;
enum server_token_type {
banner_locked = 0;
return APR_SUCCESS;
if (! banner_locked) {
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 NULL;
const char *arg)
return NULL;
int val = 0;
if (val <= 0)
return NULL;
int val = 0;
if (val <= 0)
return NULL;
int val = 0;
if (val <= 0)
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 (limit <= 0) {
if (arg2) {
if (limit <= 0) {
return NULL;
log_backtrace(r);
log_backtrace(r);
const char *arg1)
return NULL;
const char *arg)
char ch;
return NULL;
return err;
return NULL;
const char **sa)
char *d = scratch;
s = *sa;
at_start = 0;
*sa = s;
return NULL;
const char **sa)
const char *s = *sa;
*sa = ++s;
*sa = ++s;
return NULL;
while (apr_isdigit(*++s))
*sa = ++s;
return NULL;
if (!handler) {
dummy[0] = *s;
*sa = ++s;
return NULL;
const char **err,
int is_main_fmt)
sizeof(ap_errorlog_format_item));
char *res;
int seen_msg_fmt = 0;
if (res) {
return NULL;
if (!is_main_fmt) {
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
if (!arg2) {
sizeof(apr_array_header_t *));
if (*arg2) {
apr_array_header_t **e;
sizeof(apr_array_header_t *));
if (*arg2) {
apr_array_header_t **e;
return err_string;
int flags)
#ifdef GPROF
"Set to on or off for PATH_INFO to be accepted by handlers, or default for the per-handler preference"),
#ifdef RLIMIT_CPU
#ifdef RLIMIT_NPROC
/* scoreboard.c directives */
{ NULL }
char *path;
if (r->proxyreq) {
return HTTP_FORBIDDEN;
return HTTP_BAD_REQUEST;
/* skip all leading /'s (e.g. http://localhost///foo)
++path;
!= APR_SUCCESS) {
return HTTP_FORBIDDEN;
return OK;
int access_status;
return access_status;
return access_status;
return OK;
return OK;
apr_bucket *e;
core_dir_config *d;
int errstatus;
int bld_content_md5;
return errstatus;
return HTTP_NOT_FOUND;
return HTTP_NOT_FOUND;
return HTTP_NOT_FOUND;
r->method);
return HTTP_METHOD_NOT_ALLOWED;
#if APR_HAS_SENDFILE
return HTTP_FORBIDDEN;
ap_set_etag(r);
if (bld_content_md5) {
#if APR_HAS_MMAP
(void)apr_bucket_file_enable_mmap(e, 0);
|| c->aborted) {
return OK;
status);
return HTTP_INTERNAL_SERVER_ERROR;
if (r->the_request
"Invalid method in request %s - possible attempt to establish SSL connection on non-SSL port", r->the_request);
return HTTP_NOT_IMPLEMENTED;
return ap_send_http_options(r);
return HTTP_METHOD_NOT_ALLOWED;
static int sys_privileges = 0;
return sys_privileges;
return APR_SUCCESS;
if (s->defn_name)
return !OK;
return OK;
s = s->next;
return rv;
return OK;
if (!sys_privileges) {
return !OK;
return OK;
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) {
return OK;
!= APR_SUCCESS) {
return NULL;
!= APR_SUCCESS) {
return NULL;
c->base_server = s;
c->clogging_input_filters = 0;
if (log) {
net->c = c;
return DONE;
switch (query) {
case AP_SQ_MAIN_STATE:
return ap_main_state;
case AP_SQ_RUN_MODE:
return ap_run_mode;
case AP_SQ_CONFIG_GEN:
return ap_config_generation;
return AP_SQ_NOT_SUPPORTED;
#if APR_HAS_THREADS
#if APR_HAS_THREADS
int threaded_mpm;
&& threaded_mpm)
goto error;
#if APR_HAS_THREADS
if (rng_mutex)
#if APR_HAS_THREADS
if (rng_mutex)
return number;
return APR_SUCCESS;
const char *tmp;
const char **defines;
if (ap_scoreboard_fname) {
if (val)
ap_expr_init(p);