config.c revision 066877f1a045103acfdd376d48cdd473c33f409b
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering/* ====================================================================
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * The Apache Software License, Version 1.1
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * Copyright (c) 2000 The Apache Software Foundation. All rights
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * Redistribution and use in source and binary forms, with or without
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * modification, are permitted provided that the following conditions
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * 1. Redistributions of source code must retain the above copyright
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * notice, this list of conditions and the following disclaimer.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * 2. Redistributions in binary form must reproduce the above copyright
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * notice, this list of conditions and the following disclaimer in
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * the documentation and/or other materials provided with the
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * distribution.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * 3. The end-user documentation included with the redistribution,
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * if any, must include the following acknowledgment:
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * "This product includes software developed by the
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * Apache Software Foundation (http://www.apache.org/)."
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * Alternately, this acknowledgment may appear in the software itself,
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * if and wherever such third-party acknowledgments normally appear.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * 4. The names "Apache" and "Apache Software Foundation" must
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * not be used to endorse or promote products derived from this
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * software without prior written permission. For written
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * permission, please contact apache@apache.org.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * 5. Products derived from this software may not be called "Apache",
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * nor may "Apache" appear in their name, without prior written
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering * permission of the Apache Software Foundation.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
0c8570287400ba57d3705a2f62dd26039121ea6fLennart Poettering * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0c8570287400ba57d3705a2f62dd26039121ea6fLennart Poettering * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* http_config.c: once was auxillary functions for reading httpd's config
* server core can now be found next door in "http_core.c". Now contains
#include "apr.h"
#include "apr_strings.h"
#include "apr_portable.h"
#include "apr_file_io.h"
#if APR_HAVE_STDIO_H
#include <stdio.h>
#define CORE_PRIVATE
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_core.h"
#include "http_main.h"
#include "http_vhost.h"
#include "util_cfgtree.h"
#ifdef HAVE_ARPA_INET_H
#ifdef HAVE_STRINGS_H
#include <strings.h>
(r),DECLINED)
static int total_modules = 0;
static int dynamic_modules = 0;
#ifndef ap_get_module_config
#ifndef ap_set_module_config
return (void *) conf_vector;
void **conf_vector = (void **) apr_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT));
if (df)
return (void *) conf_vector;
return (void *) conf_vector;
void **conf_vector = (void **) apr_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT));
return (void *) conf_vector;
if (!virt_vector[i])
else if (df)
return create_empty_config(p);
return create_empty_config(p);
return create_empty_config(p);
const char *handler;
char *p2;
int result;
if (!r->handler) {
int methnum;
char **xmethod;
if(m->register_hooks)
m->register_hooks(p);
/* This could be called from an AddModule httpd.conf command,
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Please contact the vendor for the correct version.");
top_module = m;
* only the filename (e.g. mod_includes.c). So check for path
ap_register_hooks(m, p);
if (modp == m) {
if (!modp) {
m->name);
module **m;
*m++ = mod;
*m = NULL;
module **m;
int done;
*m++ = *m2;
*m = NULL;
module **m;
total_modules = 0;
*m2++ = *m++;
return m->name;
return modp;
return NULL;
const char *errmsg;
case RAW_ARGS:
#ifdef RESOLVE_ENV_PER_TOKEN
case NO_ARGS:
if (*args != 0)
NULL);
case TAKE1:
case TAKE2:
case TAKE12:
case TAKE3:
case TAKE23:
case TAKE123:
case TAKE13:
case ITERATE:
return errmsg;
return NULL;
case ITERATE2:
return errmsg;
return NULL;
case FLAG:
NULL);
NULL);
return cmds;
++cmds;
return NULL;
return cmdp;
return NULL;
return mconfig;
const char *args;
char *cmd_name;
return NULL;
args = l;
return NULL;
const char *retval;
if (*current) {
if (*curr_parent) {
if (*current) {
if (*current) {
if (!*conftree) {
return retval;
return NULL;
char *orig_directive)
char l[MAX_STRING_LEN];
char *bracket;
const char *retval;
return retval;
return NULL;
NULL);
const char *retval;
return NULL;
return retval;
const char *errmsg;
return errmsg;
return NULL;
char l[MAX_STRING_LEN];
const char *errmsg;
return errmsg;
return errmsg;
return NULL;
void *struct_ptr,
const char *arg)
return NULL;
void *struct_ptr,
const char *arg_)
return NULL;
return NULL;
const char *arg)
#ifndef OS2
return NULL;
#ifndef OS2
return file;
char l[MAX_STRING_LEN];
const char *args;
char *cmd_name;
args = l;
return NULL;
NULL);
int curr_idx;
return NULL;
return buf;
const char *errmsg;
if (errmsg) {
errmsg);
char *fname;
} fnames;
const char *errmsg;
/* don't require conf/httpd.conf if we have a -C or -c switch */
int current;
const char *errmsg;
if (errmsg) {
const char *d, const char *access_name) {
return OK;
while (access_name[0]) {
const char *errmsg;
ap_cfg_closefile(f);
if (errmsg) {
return HTTP_INTERNAL_SERVER_ERROR;
filename);
return HTTP_FORBIDDEN;
return OK;
s->timeout = 0;
s->keep_alive_timeout = 0;
*ps = s;
s->port = 0;
const char *confname,
p, ptemp);
p, ptemp);
module *m)
if (m->create_server_config)
(*m->create_server_config)(p, s));
if (m->create_dir_config)
module *m;
if (m->rewrite_args)
AP_DECLARE(void) ap_post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
for (n = 0; ap_loaded_modules[n]; ++n)
for (n = 0; ap_loaded_modules[n]; ++n)