config.c revision b6b7079ea8e24865adc82c4be6758b31cf4aa429
* 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"
#include "apr_fnmatch.h"
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
#include "apr_want.h"
#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"
#include "util_varbuf.h"
#include "mpm_common.h"
(pconf, s))
(pchild, s))
(r), DECLINED)
#if defined(APR_HOOK_PROBES_ENABLED)
#define APR_HOOK_INT_DCL_UD
static int total_modules = 0;
static int dynamic_modules = 0;
static int max_modules = 0;
static int conf_vector_length = 0;
static int reserved_module_slots = 0;
#ifndef AP_MAX_INCLUDE_DIR_DEPTH
return conf_vector;
if (df)
for (i = 0; i < total_modules; i++) {
if (!new_vector[i]) {
if (!virt_vector[i])
else if (df)
return create_empty_config(p);
return create_empty_config(p);
return create_empty_config(p);
while (filters) {
return result;
return OK;
const char *handler;
int result;
const char *ignore;
return result;
return result;
if (!r->handler) {
if (r->content_type) {
if (!ignore) {
int methnum;
if (m->register_hooks) {
m->register_hooks(p);
struct ap_mod_list_struct {
module *m;
module **m;
if (add_prelinked) {
ap_add_module_commands(*m, p);
char *dir;
rebuild_conf_hash(p, 0);
mln->m = m;
++cmd;
const char *sym_name)
/* This could be called from a LoadModule httpd.conf command,
else if (!sym_name) {
sym++;
ap_top_module = m;
if (sym_name) {
* only the filename (e.g. mod_includes.c). So check for path
#ifdef _OSD_POSIX
ap_add_module_commands(m, p);
ap_register_hooks(m, p);
return NULL;
if (modp == m) {
if (!modp) {
m->name);
const char *short_name)
module **m;
const char *error;
if (error) {
return error;
*m++ = mod;
*m = NULL;
return NULL;
module **m;
int done;
*m++ = *m2;
*m = NULL;
module **m;
const char *error;
total_modules = 0;
if (!ap_module_short_names)
if (!merger_func_cache)
*m2++ = *m++;
if (error) {
return error;
return NULL;
return m->name;
return NULL;
return modp;
return NULL;
int override_list_ok = 0;
return NULL;
case RAW_ARGS:
#ifdef RESOLVE_ENV_PER_TOKEN
case TAKE_ARGV:
int argc = 0;
argc++;
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 errmsg;
case ITERATE2:
return errmsg;
return errmsg;
case FLAG:
NULL);
NULL);
return cmds;
++cmds;
return NULL;
return cmdp;
return NULL;
const char *section,
return section_config;
const char *args;
char *cmd_name;
return NULL;
args = l;
return NULL;
if (*current) {
if (*curr_parent) {
if (*current) {
if (*current) {
if (!*conftree) {
return retval;
return retval;
char *orig_directive)
char *bracket;
const char *retval;
if (p == temp_pool)
== APR_SUCCESS) {
return retval;
return NULL;
return NULL;
NULL);
ml->m,
const char *retval;
return retval;
return NULL;
const char *errmsg;
return errmsg;
return NULL;
const char *errmsg;
if (p == temp_pool)
if(last_ptr) {
== APR_SUCCESS) {
return errmsg;
return errmsg;
return NULL;
void *struct_ptr,
const char *arg)
return NULL;
void *struct_ptr,
const char *arg)
char *endptr;
return error_str;
void *struct_ptr,
const char *arg_)
return NULL;
return NULL;
return NULL;
const char *arg)
const char *path;
if (!path) {
return NULL;
void *struct_ptr,
const char *arg)
if (l->module_levels)
if (!l->module_levels) {
return newpath;
return NULL;
const char *runtime_dir = ap_runtime_dir ? ap_runtime_dir : ap_server_root_relative(p, DEFAULT_REL_RUNTIMEDIR);
return newpath;
return NULL;
const char *args;
char *cmd_name;
== APR_SUCCESS) {
const char *msg;
return msg;
NULL);
NULL);
const char *retval;
return retval;
return NULL;
int curr_idx;
char *elt;
return APR_EOF;
return APR_ENOSPC;
return APR_SUCCESS;
return APR_SUCCESS;
apr_pool_t *p,
const char *errmsg;
if (errmsg) {
NULL);
return NULL;
const char *fname;
} fnames;
const char *fname,
apr_pool_t *p,
const char *error;
if (error) {
return error;
return NULL;
const char *fname,
apr_pool_t *p,
unsigned depth,
int optional)
const char *error;
int current;
if (error) {
return error;
return NULL;
const char *path,
const char *fname,
apr_pool_t *p,
unsigned depth,
int optional)
const char *rest;
int current;
if (rest) {
rest++;
if (!rest) {
conftree, p,
conftree, p,
const char *error;
if (!rest) {
conftree, p,
conftree, p,
if (error) {
return error;
if (!optional) {
return NULL;
const char *fname,
apr_pool_t *p,
int optional)
/* don't require conf/httpd.conf if we have a -C or -c switch */
return NULL;
0, optional);
apr_pool_t *p,
const char *errmsg;
if (errmsg) {
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
const char *access_name,
const char **full_name)
const char *d, const char *access_names)
const char *filename;
return OK;
while (access_names[0]) {
const char *errmsg;
ap_cfg_closefile(f);
if (errmsg) {
return HTTP_INTERNAL_SERVER_ERROR;
filename, d);
return HTTP_FORBIDDEN;
return OK;
const char *hostname,
s->timeout = 0;
s->keep_alive_timeout = 0;
*ps = s;
if (old) {
l->module_levels =
for (i = 0; i < conf_vector_length; i++) {
s->port = 0;
return NULL;
return APR_SUCCESS;
return OK;
const char *filename,
if (s == NULL) {
p, ptemp);
if (error) {
return NULL;
if (!confname) {
filename);
return NULL;
if (error) {
return NULL;
if (error) {
return NULL;
p, ptemp);
if (error) {
return NULL;
module *m)
if (m->create_server_config)
(*m->create_server_config)(p, s));
if (m->create_dir_config)
module *m;
if (m->rewrite_args) {
for (n = 0; ap_loaded_modules[n]; ++n) {
for (n = 0; ap_loaded_modules[n]; ++n)
void *retained;
return retained;
void *retained;
return retained;
int count = 0;
count++;
return count;