httpd.h revision 91f0d8da77152d24e4bbb31ce199282b3fd6e3b2
2d2eda71267231c2526be701fe655db125852c1ffielding/* ====================================================================
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * The Apache Software License, Version 1.1
f062ed7bd262a37a909dd77ce5fc23b446818823fielding *
33bdcae1f7a1a65e351dda2a766a0cf28b1e695dnd * Copyright (c) 2000 The Apache Software Foundation. All rights
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * reserved.
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * Redistribution and use in source and binary forms, with or without
2d2eda71267231c2526be701fe655db125852c1ffielding * modification, are permitted provided that the following conditions
2d2eda71267231c2526be701fe655db125852c1ffielding * are met:
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * 1. Redistributions of source code must retain the above copyright
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * notice, this list of conditions and the following disclaimer.
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * 2. Redistributions in binary form must reproduce the above copyright
2d2eda71267231c2526be701fe655db125852c1ffielding * notice, this list of conditions and the following disclaimer in
2d2eda71267231c2526be701fe655db125852c1ffielding * the documentation and/or other materials provided with the
2d2eda71267231c2526be701fe655db125852c1ffielding * distribution.
2d2eda71267231c2526be701fe655db125852c1ffielding *
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 3. The end-user documentation included with the redistribution,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * if any, must include the following acknowledgment:
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * "This product includes software developed by the
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Apache Software Foundation (http://www.apache.org/)."
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Alternately, this acknowledgment may appear in the software itself,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * if and wherever such third-party acknowledgments normally appear.
2d2eda71267231c2526be701fe655db125852c1ffielding *
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 4. The names "Apache" and "Apache Software Foundation" must
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * not be used to endorse or promote products derived from this
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * software without prior written permission. For written
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * permission, please contact apache@apache.org.
2d2eda71267231c2526be701fe655db125852c1ffielding *
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 5. Products derived from this software may not be called "Apache",
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * nor may "Apache" appear in their name, without prior written
64185f9824e42f21ca7b9ae6c004484215c031a7rbb * permission of the Apache Software Foundation.
2d2eda71267231c2526be701fe655db125852c1ffielding *
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
2d2eda71267231c2526be701fe655db125852c1ffielding * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * SUCH DAMAGE.
2d2eda71267231c2526be701fe655db125852c1ffielding * ====================================================================
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * This software consists of voluntary contributions made by many
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * individuals on behalf of the Apache Software Foundation. For more
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * information on the Apache Software Foundation, please see
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * <http://www.apache.org/>.
2d2eda71267231c2526be701fe655db125852c1ffielding *
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Portions of this software are based upon public domain software
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * originally written at the National Center for Supercomputing Applications,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * University of Illinois, Urbana-Champaign.
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef APACHE_HTTPD_H
2d2eda71267231c2526be701fe655db125852c1ffielding#define APACHE_HTTPD_H
2d2eda71267231c2526be701fe655db125852c1ffielding
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#ifdef __cplusplus
0432a26b69eedfb9ca5f34fba590236378a24851benextern "C" {
0432a26b69eedfb9ca5f34fba590236378a24851ben#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/*
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * httpd.h: header for simple (ha! not anymore) http daemon
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* XXX - We need to push more stuff to other .h files, or even .c files, to
2d2eda71267231c2526be701fe655db125852c1ffielding * make this file smaller
30c289e6bc6d28d210b21edd800ab2cfc78a8381wrowe */
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein/**
cd39d2139743ca0ef899953c6496dcf99e9c791atrawick * @package HTTP Daemon routines
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein */
b627048681b27fe30f979ba471b523be3a6a22adrbb
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein/* Headers in which EVERYONE has an interest... */
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein#include "ap_config.h"
44c46ef733836b32585d135d2d90856e7cfd9929rbb#include "os.h"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#include "apr_general.h"
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb#include "apr_lib.h"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#include "apr_time.h"
9cfc48b742c224c1fbc2c26a4119a3266192c7d2wrowe#include "apr_network_io.h"
9cfc48b742c224c1fbc2c26a4119a3266192c7d2wrowe#include "buff.h"
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#include "ap_mmn.h"
7c7372abe2484e7fcf81937b93496d1246e5b816gstein
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#ifdef HAVE_NETINET_IN_H
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#include <netinet/in.h>
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#endif
7c7372abe2484e7fcf81937b93496d1246e5b816gstein
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#ifdef CORE_PRIVATE
7c7372abe2484e7fcf81937b93496d1246e5b816gstein
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* ----------------------------- config dir ------------------------------ */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Define this to be the default server home dir. Most things later in this
2d2eda71267231c2526be701fe655db125852c1ffielding * file with a relative pathname will have this added.
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef HTTPD_ROOT
2d2eda71267231c2526be701fe655db125852c1ffielding#ifdef OS2
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTPD_ROOT "/os2httpd"
2d2eda71267231c2526be701fe655db125852c1ffielding#elif defined(WIN32)
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for Windows file system */
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTPD_ROOT "/apache"
2d2eda71267231c2526be701fe655db125852c1ffielding#elif defined (BEOS)
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set the default for BeOS */
2e123e8beedc9f921448c113e2d6823a92fd5261fielding#define HTTPD_ROOT "/boot/home/apache"
2e123e8beedc9f921448c113e2d6823a92fd5261fielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTPD_ROOT "/usr/local/apache"
dd5cbadf2df719db2f3c769d03ec847da25854e6bnicholes#endif
dd5cbadf2df719db2f3c769d03ec847da25854e6bnicholes#endif /* HTTPD_ROOT */
dd5cbadf2df719db2f3c769d03ec847da25854e6bnicholes
2d2eda71267231c2526be701fe655db125852c1ffielding/*
2d2eda71267231c2526be701fe655db125852c1ffielding * --------- You shouldn't have to edit anything below this line ----------
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * Any modifications to any defaults not defined above should be done in the
2d2eda71267231c2526be701fe655db125852c1ffielding * respective configuration file.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb *
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Default location of documents. Can be overridden by the DocumentRoot
72a4ef8eac1adef882246c5bfb9b8bbd82d613c4coar * directive.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef DOCUMENT_LOCATION
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifdef OS2
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
2d2eda71267231c2526be701fe655db125852c1ffielding#define DOCUMENT_LOCATION HTTPD_ROOT "/docs"
2d2eda71267231c2526be701fe655db125852c1ffielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding#define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DOCUMENT_LOCATION */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Maximum number of dynamically loaded modules */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DYNAMIC_MODULE_LIMIT
2d2eda71267231c2526be701fe655db125852c1ffielding#define DYNAMIC_MODULE_LIMIT 64
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
57edbe3cb9356a0b599c7b07f3aae0e721ee57e2coar/* Default administrator's address */
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_ADMIN "[no address given]"
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The target name of the installed Apache */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef TARGET
2d2eda71267231c2526be701fe655db125852c1ffielding#define TARGET "httpd"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* --------- Default user name and group name ----------------------------- */
2d2eda71267231c2526be701fe655db125852c1ffielding/* --- These may be specified as numbers by placing a # before a number --- */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_USER
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_USER "#-1"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_GROUP
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_GROUP "#-1"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The name of the log files */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_XFERLOG
2d2eda71267231c2526be701fe655db125852c1ffielding#if defined(OS2) || defined(WIN32)
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_XFERLOG "logs/access.log"
2d2eda71267231c2526be701fe655db125852c1ffielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_XFERLOG "logs/access_log"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_XFERLOG */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_ERRORLOG
2d2eda71267231c2526be701fe655db125852c1ffielding#if defined(OS2) || defined(WIN32)
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_ERRORLOG "logs/error.log"
2d2eda71267231c2526be701fe655db125852c1ffielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_ERRORLOG "logs/error_log"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_ERRORLOG */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Define this to be what your per-directory security files are called */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_ACCESS_FNAME
2d2eda71267231c2526be701fe655db125852c1ffielding#ifdef OS2
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
dbbf1b4183ae16353011a5269b37899f02b97d81gregames#define DEFAULT_ACCESS_FNAME "htaccess"
2d2eda71267231c2526be701fe655db125852c1ffielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_ACCESS_FNAME ".htaccess"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_ACCESS_FNAME */
e44e11f9fece12c783f18d033923bfc0d6b4289aake
2d2eda71267231c2526be701fe655db125852c1ffielding/* The name of the server config file */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef SERVER_CONFIG_FILE
2d2eda71267231c2526be701fe655db125852c1ffielding#define SERVER_CONFIG_FILE "conf/httpd.conf"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
e44e11f9fece12c783f18d033923bfc0d6b4289aake
2d2eda71267231c2526be701fe655db125852c1ffielding/* Whether we should enable rfc1413 identity checking */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_RFC1413
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_RFC1413 0
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The default path for CGI scripts if none is currently set */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_PATH
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The path to the suExec wrapper, can be overridden in Configuration */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef SUEXEC_BIN
2d2eda71267231c2526be701fe655db125852c1ffielding#define SUEXEC_BIN HTTPD_ROOT "/sbin/suexec"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The timeout for waiting for messages */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_TIMEOUT
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_TIMEOUT 300
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The timeout for waiting for keepalive timeout until next request */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_KEEPALIVE_TIMEOUT
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_KEEPALIVE_TIMEOUT 15
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The number of requests to entertain per connection */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef DEFAULT_KEEPALIVE
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_KEEPALIVE 100
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The maximum length of the queue of pending connections, as defined
2d2eda71267231c2526be701fe655db125852c1ffielding * by listen(2). Under some systems, it should be increased if you
2d2eda71267231c2526be701fe655db125852c1ffielding * are experiencing a heavy TCP SYN flood attack.
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet *
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * It defaults to 511 instead of 512 because some systems store it
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet * as an 8-bit datatype; 512 truncated to 8-bits is 0, while 511 is
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet * 255 when truncated.
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet */
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet#ifndef DEFAULT_LISTENBACKLOG
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DEFAULT_LISTENBACKLOG 511
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Limits on the size of various request items. These limits primarily
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * exist to prevent simple denial-of-service attacks on a server based
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * on misuse of the protocol. The recommended values will depend on the
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * nature of the server resources -- CGI scripts and database backends
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * might require large values, but most servers could get by with much
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * smaller limits than we use below. The request message body size can
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * be limited by the per-dir config directive LimitRequestBody.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb *
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * These two limits can be lowered (but not raised) by the server config
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * directives LimitRequestLine and LimitRequestFieldsize, respectively.
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh *
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * the server config directive LimitRequestFields.
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef DEFAULT_LIMIT_REQUEST_LINE
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DEFAULT_LIMIT_REQUEST_LINE 8190
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif /* default limit on bytes in any one header field */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DEFAULT_LIMIT_REQUEST_FIELDS 100
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif /* default limit on number of request header fields */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/*
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * The default default character set name to add if AddDefaultCharset is
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * enabled. Overridden with AddDefaultCharsetName.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/*
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * The below defines the base string of the Server: header. Additional
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * tokens can be added via the ap_add_version_component() API call.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb *
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * The tokens are listed in order of their significance for identifying the
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * application.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb *
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * "Product tokens should be short and to the point -- use of them for
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * advertizing or other non-essential information is explicitly forbidden."
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh *
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Example: "Apache/1.1.0 MrWidget/0.1-alpha"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
99d6d3207e24ba1f8eba77ef903948d738886cf5nd/* Define this to 1 if you want fancy indexing, 0 otherwise */
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#ifndef DEFAULT_INDEXING
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define DEFAULT_INDEXING 0
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#endif
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#endif /* CORE_PRIVATE */
99d6d3207e24ba1f8eba77ef903948d738886cf5nd
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_BASEVENDOR "Apache Software Foundation"
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_BASEPRODUCT "Apache"
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_BASEREVISION "2.0a7"
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_BASEVERSION AP_SERVER_BASEPRODUCT "/" AP_SERVER_BASEREVISION
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_VERSION AP_SERVER_BASEVERSION
99d6d3207e24ba1f8eba77ef903948d738886cf5nd
99d6d3207e24ba1f8eba77ef903948d738886cf5nd#define AP_SERVER_PROTOCOL "HTTP/1.1"
99d6d3207e24ba1f8eba77ef903948d738886cf5nd
99d6d3207e24ba1f8eba77ef903948d738886cf5nd
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* ------------------ stuff that modules are allowed to look at ----------- */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Define this to be what your HTML directory content files are called */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef AP_DEFAULT_INDEX
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define AP_DEFAULT_INDEX "index.html"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Define this to be what type you'd like returned for files with unknown */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* suffixes. MUST be all lower case. */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#ifndef DEFAULT_CONTENT_TYPE
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define DEFAULT_CONTENT_TYPE "text/plain"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* The name of the MIME types file */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#ifndef AP_TYPES_CONFIG_FILE
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define AP_TYPES_CONFIG_FILE "conf/mime.types"
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#endif
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/*
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Define the HTML doctype strings centrally.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "DTD HTML 2.0//EN\">\n"
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "DTD HTML 3.2 Final//EN\">\n"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "DTD HTML 4.0//EN\"\n" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "DTD HTML 4.0 Transitional//EN\"\n" \
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 4.0 Frameset//EN\"\n" \
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* -- Internal representation for a HTTP protocol number, e.g., HTTP/1.1 -- */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_VERSION(major,minor) (1000*(major)+(minor))
1374444b4fab1475091e12a81663f379b73005efrbb#define HTTP_VERSION_MAJOR(number) ((number)/1000)
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define HTTP_VERSION_MINOR(number) ((number)%1000)
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker/* -------------- Port number for server running standalone --------------- */
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define DEFAULT_HTTP_PORT 80
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define DEFAULT_HTTPS_PORT 443
c8aa00ee0cfc17b5fa08fb8a2b08d30dc9e4f1b1wrowe#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
c8aa00ee0cfc17b5fa08fb8a2b08d30dc9e4f1b1wrowe#define ap_http_method(r) ap_run_http_method(r)
4542d057c4bde23857f31d449fa3108561206139wrowe#define ap_default_port(r) ap_run_default_port(r)
c8aa00ee0cfc17b5fa08fb8a2b08d30dc9e4f1b1wrowe
4542d057c4bde23857f31d449fa3108561206139wrowe/* The default string lengths */
c8aa00ee0cfc17b5fa08fb8a2b08d30dc9e4f1b1wrowe#define MAX_STRING_LEN HUGE_STRING_LEN
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HUGE_STRING_LEN 8192
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* The size of the server's internal read-write buffers */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define IOBUFSIZE 8192
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh/*
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Special Apache error codes. These are basically used
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * in http_main.c so we can keep track of various errors.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb *
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * APEXIT_OK:
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * A normal exit
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * APEXIT_INIT:
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * A fatal error arising during the server's init sequence
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * APEXIT_CHILDINIT:
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * The child died during it's init sequence
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * APEXIT_CHILDFATAL:
6d74c65f131583f6832b04424c1a9e1e7cc72c8egregames * A fatal error, resulting in the whole server aborting.
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * If a child exits with this error, the parent process
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * considers this a server-wide fatal error and aborts.
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh *
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define APEXIT_OK 0x0
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define APEXIT_INIT 0x2
2e123e8beedc9f921448c113e2d6823a92fd5261fielding#define APEXIT_CHILDINIT 0x3
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define APEXIT_CHILDFATAL 0xf
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(const char *) ap_get_server_version(void);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(const char *) ap_get_server_built(void);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/* Numeric release version identifier: MMNNFFRBB: major minor fix final beta
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Always increases along the same track as the source branch.
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'.
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define APACHE_RELEASE 20000007
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DECLINED -1 /* Module declines to handle */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define DONE -2 /* Module has served the response completely
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * - it's safe to die() with no more output
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define OK 0 /* Module has handled this stage. */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe/* ----------------------- HTTP Status Codes ------------------------- */
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe/* The size of the static array in http_protocol.c for storing
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * all of the potential response status-lines (a sparse table).
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe * A future version should dynamically generate the apr_table_t at startup.
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe */
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe#define RESPONSE_CODES 55
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe#define HTTP_CONTINUE 100
64b9fa4bc3e79b0eefb2d93fb56eae40d88e0f06wrowe#define HTTP_SWITCHING_PROTOCOLS 101
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_PROCESSING 102
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_OK 200
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_CREATED 201
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_ACCEPTED 202
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_NON_AUTHORITATIVE 203
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_NO_CONTENT 204
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_RESET_CONTENT 205
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_PARTIAL_CONTENT 206
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_MULTI_STATUS 207
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_MULTIPLE_CHOICES 300
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_MOVED_PERMANENTLY 301
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_MOVED_TEMPORARILY 302
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_SEE_OTHER 303
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_NOT_MODIFIED 304
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_USE_PROXY 305
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_TEMPORARY_REDIRECT 307
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_BAD_REQUEST 400
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_UNAUTHORIZED 401
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_PAYMENT_REQUIRED 402
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_FORBIDDEN 403
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_NOT_FOUND 404
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_METHOD_NOT_ALLOWED 405
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_NOT_ACCEPTABLE 406
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#define HTTP_REQUEST_TIME_OUT 408
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_CONFLICT 409
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_GONE 410
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_LENGTH_REQUIRED 411
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#define HTTP_PRECONDITION_FAILED 412
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_REQUEST_ENTITY_TOO_LARGE 413
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_REQUEST_URI_TOO_LARGE 414
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#define HTTP_UNSUPPORTED_MEDIA_TYPE 415
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_RANGE_NOT_SATISFIABLE 416
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_EXPECTATION_FAILED 417
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_UNPROCESSABLE_ENTITY 422
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_LOCKED 423
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#define HTTP_FAILED_DEPENDENCY 424
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#define HTTP_INTERNAL_SERVER_ERROR 500
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTP_NOT_IMPLEMENTED 501
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_BAD_GATEWAY 502
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_SERVICE_UNAVAILABLE 503
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTP_GATEWAY_TIME_OUT 504
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTP_VERSION_NOT_SUPPORTED 505
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define HTTP_VARIANT_ALSO_VARIES 506
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTP_INSUFFICIENT_STORAGE 507
2d2eda71267231c2526be701fe655db125852c1ffielding#define HTTP_NOT_EXTENDED 510
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_status_drops_connection(x) \
4d88cba691cf0cc222161dc403067071eca58751rbb (((x) == HTTP_BAD_REQUEST) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_REQUEST_TIME_OUT) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_LENGTH_REQUIRED) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_SERVICE_UNAVAILABLE) || \
2d2eda71267231c2526be701fe655db125852c1ffielding ((x) == HTTP_NOT_IMPLEMENTED))
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Methods recognized (but not necessarily handled) by the server.
2d2eda71267231c2526be701fe655db125852c1ffielding * These constants are used in bit shifting masks of size int, so it is
2d2eda71267231c2526be701fe655db125852c1ffielding * unsafe to have more methods than bits in an int. HEAD == M_GET.
2d2eda71267231c2526be701fe655db125852c1ffielding * This list must be tracked by the list in http_protocol.c in routine
2d2eda71267231c2526be701fe655db125852c1ffielding * ap_method_name_of().
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_GET 0
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_PUT 1
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_POST 2
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_DELETE 3
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_CONNECT 4
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_OPTIONS 5
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_TRACE 6
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_PATCH 7
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_PROPFIND 8
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_PROPPATCH 9
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_MKCOL 10
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_COPY 11
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_MOVE 12
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_LOCK 13
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_UNLOCK 14
2d2eda71267231c2526be701fe655db125852c1ffielding#define M_INVALID 15
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding#define METHODS 16
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/*
2d2eda71267231c2526be701fe655db125852c1ffielding * Structure for handling HTTP methods. Methods known to the server are
2d2eda71267231c2526be701fe655db125852c1ffielding * accessed via a bitmask shortcut; extension methods are handled by
2d2eda71267231c2526be701fe655db125852c1ffielding * an array.
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffieldingtypedef struct {
2d2eda71267231c2526be701fe655db125852c1ffielding int method_mask;
4d88cba691cf0cc222161dc403067071eca58751rbb apr_array_header_t *method_list;
2d2eda71267231c2526be701fe655db125852c1ffielding} ap_method_list_t;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding#define CGI_MAGIC_TYPE "application/x-httpd-cgi"
2d2eda71267231c2526be701fe655db125852c1ffielding#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
2d2eda71267231c2526be701fe655db125852c1ffielding#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
2d2eda71267231c2526be701fe655db125852c1ffielding#define DIR_MAGIC_TYPE "httpd/unix-directory"
2d2eda71267231c2526be701fe655db125852c1ffielding#ifdef CHARSET_EBCDIC
2d2eda71267231c2526be701fe655db125852c1ffielding#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /*CHARSET_EBCDIC*/
2d2eda71267231c2526be701fe655db125852c1ffielding
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh/* Just in case your linefeed isn't the one the other end is expecting. */
2d2eda71267231c2526be701fe655db125852c1ffielding#ifndef CHARSET_EBCDIC
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define LF 10
2d2eda71267231c2526be701fe655db125852c1ffielding#define CR 13
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define CRLF "\015\012"
2d2eda71267231c2526be701fe655db125852c1ffielding#else /* CHARSET_EBCDIC */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh/* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
2d2eda71267231c2526be701fe655db125852c1ffielding * in the buff package (bread/bputs/bwrite). Everywhere else, we use
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * "native EBCDIC" CR and NL characters. These are therefore
2d2eda71267231c2526be701fe655db125852c1ffielding * defined as
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * '\r' and '\n'.
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffielding#define CR '\r'
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define LF '\n'
2d2eda71267231c2526be701fe655db125852c1ffielding#define CRLF "\r\n"
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* CHARSET_EBCDIC */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Possible values for request_rec.read_body (set by handling module):
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_NO_BODY Send 413 error if message has any body
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me.
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_PASS Pass the chunks to me without removal.
2d2eda71267231c2526be701fe655db125852c1ffielding */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define REQUEST_NO_BODY 0
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define REQUEST_CHUNKED_ERROR 1
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define REQUEST_CHUNKED_DECHUNK 2
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh#define REQUEST_CHUNKED_PASS 3
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh/* Things which may vary per file-lookup WITHIN a request ---
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * e.g., state of MIME config. Basically, the name of an object, info
2d2eda71267231c2526be701fe655db125852c1ffielding * about the object, and any other info we may ahve which may need to
2d2eda71267231c2526be701fe655db125852c1ffielding * change as we go poking around looking for it (e.g., overridden by
763f7b125b6d3dd1e4992a3822005efa2616f983coar * .htaccess files).
763f7b125b6d3dd1e4992a3822005efa2616f983coar *
2d2eda71267231c2526be701fe655db125852c1ffielding * Note how the default state of almost all these things is properly
5a9667916c79d8c699b069068e5570aa1c331c80gstein * zero, so that allocating it with pcalloc does the right thing without
5a9667916c79d8c699b069068e5570aa1c331c80gstein * a whole lot of hairy initialization... so long as we are willing to
5a9667916c79d8c699b069068e5570aa1c331c80gstein * make the (fairly) portable assumption that the bit pattern of a NULL
5a9667916c79d8c699b069068e5570aa1c331c80gstein * pointer is, in fact, zero.
5a9667916c79d8c699b069068e5570aa1c331c80gstein */
5a9667916c79d8c699b069068e5570aa1c331c80gstein
5a9667916c79d8c699b069068e5570aa1c331c80gstein/**
5a9667916c79d8c699b069068e5570aa1c331c80gstein * This represents the result of calling htaccess; these are cached for
5a9667916c79d8c699b069068e5570aa1c331c80gstein * each request.
5a9667916c79d8c699b069068e5570aa1c331c80gstein */
5a9667916c79d8c699b069068e5570aa1c331c80gsteinstruct htaccess_result {
5a9667916c79d8c699b069068e5570aa1c331c80gstein /** the directory to which this applies */
5a9667916c79d8c699b069068e5570aa1c331c80gstein const char *dir;
5a9667916c79d8c699b069068e5570aa1c331c80gstein /** the overrides allowed for the .htaccess file */
5a9667916c79d8c699b069068e5570aa1c331c80gstein int override;
5a9667916c79d8c699b069068e5570aa1c331c80gstein /** the configuration directives */
5a9667916c79d8c699b069068e5570aa1c331c80gstein void *htaccess;
5a9667916c79d8c699b069068e5570aa1c331c80gstein /** the next one, or NULL if no more; N.B. never change this */
5a9667916c79d8c699b069068e5570aa1c331c80gstein const struct htaccess_result *next;
5a9667916c79d8c699b069068e5570aa1c331c80gstein};
5a9667916c79d8c699b069068e5570aa1c331c80gstein
5a9667916c79d8c699b069068e5570aa1c331c80gstein/* The following four types define a hierarchy of activities, so that
5a9667916c79d8c699b069068e5570aa1c331c80gstein * given a request_rec r you can write r->connection->server->process
5a9667916c79d8c699b069068e5570aa1c331c80gstein * to get to the process_rec. While this reduces substantially the
5a9667916c79d8c699b069068e5570aa1c331c80gstein * number of arguments that various hooks require beware that in
5a9667916c79d8c699b069068e5570aa1c331c80gstein * threaded versions of the server you must consider multiplexing
5a9667916c79d8c699b069068e5570aa1c331c80gstein * issues. */
2d2eda71267231c2526be701fe655db125852c1ffielding
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianhtypedef struct process_rec process_rec;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianhtypedef struct server_rec server_rec;
62db15de4c1f335a64d45821796ae197cff94ef8rbbtypedef struct conn_rec conn_rec;
62db15de4c1f335a64d45821796ae197cff94ef8rbbtypedef struct request_rec request_rec;
62db15de4c1f335a64d45821796ae197cff94ef8rbb
2d2eda71267231c2526be701fe655db125852c1ffielding#include "util_uri.h"
48d2edbfb84e5559b5da0f8d614ccab805cc67a8rbb
48d2edbfb84e5559b5da0f8d614ccab805cc67a8rbb#ifdef APACHE_XLATE
48d2edbfb84e5559b5da0f8d614ccab805cc67a8rbb#include "apr_xlate.h"
5a9667916c79d8c699b069068e5570aa1c331c80gstein
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh/** structure to aid charset translate between machine and network */
48d2edbfb84e5559b5da0f8d614ccab805cc67a8rbbstruct ap_rr_xlate {
48d2edbfb84e5559b5da0f8d614ccab805cc67a8rbb /* contents are experimental! expect it to change! */
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb /** translation handle to use when going to the network */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar apr_xlate_t *to_net;
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar /** whether or not write translation is single-byte-only */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar int to_net_sb;
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar /** translation handle to use when coming from the network */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh apr_xlate_t *from_net;
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb};
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb#endif /*APACHE_XLATE*/
62db15de4c1f335a64d45821796ae197cff94ef8rbb
62db15de4c1f335a64d45821796ae197cff94ef8rbb/** A structure that represents one process */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coarstruct process_rec {
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb /** Global pool. Please try to cleared on _all_ exits */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh apr_pool_t *pool;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** aka configuration pool, cleared on restarts */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh apr_pool_t *pconf;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** How many command line arguments were pass to the program */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh int argc;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The command line arguments */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh char *const *argv;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The program name used to execute the program */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh const char *short_name;
2d2eda71267231c2526be701fe655db125852c1ffielding};
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
2d2eda71267231c2526be701fe655db125852c1ffielding/** A structure that represents the current request */
2d2eda71267231c2526be701fe655db125852c1ffieldingstruct request_rec {
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** The pool associated with the request */
54e94821097724bf413d2d4cc70711760f7494e1trawick apr_pool_t *pool;
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick /** The connection over which this connection has been read */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh conn_rec *connection;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The virtual host this request is for */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh server_rec *server;
2d2eda71267231c2526be701fe655db125852c1ffielding
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** If we wind up getting redirected, pointer to the request we
54e94821097724bf413d2d4cc70711760f7494e1trawick * redirected to. */
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick request_rec *next;
54e94821097724bf413d2d4cc70711760f7494e1trawick /** If this is an internal redirect, pointer to where we redirected
54e94821097724bf413d2d4cc70711760f7494e1trawick * *from*. */
54e94821097724bf413d2d4cc70711760f7494e1trawick request_rec *prev;
54e94821097724bf413d2d4cc70711760f7494e1trawick
54e94821097724bf413d2d4cc70711760f7494e1trawick /** If this is a sub_request (see request.h) pointer back to the
54e94821097724bf413d2d4cc70711760f7494e1trawick * main request. */
54e94821097724bf413d2d4cc70711760f7494e1trawick request_rec *main;
54e94821097724bf413d2d4cc70711760f7494e1trawick
54e94821097724bf413d2d4cc70711760f7494e1trawick /* Info about the request itself... we begin with stuff that only
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick * protocol.c should ever touch...
2d2eda71267231c2526be701fe655db125852c1ffielding */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** First line of request, so we can log it */
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe char *the_request;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** HTTP/0.9, "simple" request */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh int assbackwards;
2d2eda71267231c2526be701fe655db125852c1ffielding /** A proxy request (calculated during post_read_request/translate_name) */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh int proxyreq;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** HEAD request, as opposed to GET */
2d2eda71267231c2526be701fe655db125852c1ffielding int header_only;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** Protocol, as given to us, or HTTP/0.9 */
2d2eda71267231c2526be701fe655db125852c1ffielding char *protocol;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** Number version of protocol; 1.1 = 1001 */
2d2eda71267231c2526be701fe655db125852c1ffielding int proto_num;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** Host, as set by full URI or Host: */
2d2eda71267231c2526be701fe655db125852c1ffielding const char *hostname;
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe /** When the request started */
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe apr_time_t request_time;
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe /** Status line, if set by script */
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe const char *status_line;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** In any case */
e57fd661645dcfdf166e77484b509b248e62a19eaaron int status;
e57fd661645dcfdf166e77484b509b248e62a19eaaron
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
e57fd661645dcfdf166e77484b509b248e62a19eaaron * look, but don't touch.
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe */
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe /** GET, HEAD, POST, etc. */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh const char *method;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** M_GET, M_POST, etc. */
2d2eda71267231c2526be701fe655db125852c1ffielding int method_number;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /** <PRE>
2d2eda71267231c2526be701fe655db125852c1ffielding * allowed is a bitvector of the allowed methods.
2d2eda71267231c2526be701fe655db125852c1ffielding *
2d2eda71267231c2526be701fe655db125852c1ffielding * A handler must ensure that the request method is one that
2d2eda71267231c2526be701fe655db125852c1ffielding * it is capable of handling. Generally modules should DECLINE
2d2eda71267231c2526be701fe655db125852c1ffielding * any request methods they do not handle. Prior to aborting the
2d2eda71267231c2526be701fe655db125852c1ffielding * handler like this the handler should set r->allowed to the list
2d2eda71267231c2526be701fe655db125852c1ffielding * of methods that it is willing to handle. This bitvector is used
2d2eda71267231c2526be701fe655db125852c1ffielding * to construct the "Allow:" header required for OPTIONS requests,
2d2eda71267231c2526be701fe655db125852c1ffielding * and HTTP_METHOD_NOT_ALLOWED and HTTP_NOT_IMPLEMENTED status codes.
952908500d5f99f35afc5ed510391b9bdc3833farbb *
952908500d5f99f35afc5ed510391b9bdc3833farbb * Since the default_handler deals with OPTIONS, all modules can
2d2eda71267231c2526be701fe655db125852c1ffielding * usually decline to deal with OPTIONS. TRACE is always allowed,
2d2eda71267231c2526be701fe655db125852c1ffielding * modules don't need to set it explicitly.
2d2eda71267231c2526be701fe655db125852c1ffielding *
952908500d5f99f35afc5ed510391b9bdc3833farbb * Since the default_handler will always handle a GET, a
952908500d5f99f35afc5ed510391b9bdc3833farbb * module which does *not* implement GET should probably return
952908500d5f99f35afc5ed510391b9bdc3833farbb * HTTP_METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET
952908500d5f99f35afc5ed510391b9bdc3833farbb * handler can't be installed by mod_actions. </PRE>
952908500d5f99f35afc5ed510391b9bdc3833farbb */
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein int allowed; /* Allowed methods - for 405, OPTIONS, etc */
952908500d5f99f35afc5ed510391b9bdc3833farbb apr_array_header_t *allowed_xmethods; /* Array of extension methods */
2d2eda71267231c2526be701fe655db125852c1ffielding ap_method_list_t *allowed_methods; /* List of allowed methods */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /** byte count in stream is for body */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde int sent_bodyct;
3887202241db08986e94b252fbd06a55e55d4b2dbhyde /** body byte count, for easy access */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde long bytes_sent;
3887202241db08986e94b252fbd06a55e55d4b2dbhyde /** Time the resource was last modified */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde apr_time_t mtime;
3887202241db08986e94b252fbd06a55e55d4b2dbhyde
3887202241db08986e94b252fbd06a55e55d4b2dbhyde /* HTTP/1.1 connection-level features */
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** sending chunked transfer-coding */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde int chunked;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** number of byte ranges */
2d2eda71267231c2526be701fe655db125852c1ffielding int byterange;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** multipart/byteranges boundary */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde char *boundary;
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh /** The Range: header */
2d2eda71267231c2526be701fe655db125852c1ffielding const char *range;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The "real" content length */
7c7372abe2484e7fcf81937b93496d1246e5b816gstein long clength;
7c7372abe2484e7fcf81937b93496d1246e5b816gstein
864c5615d55b8ebbde24e72043f6325741335a74fielding /** bytes left to read */
2d2eda71267231c2526be701fe655db125852c1ffielding long remaining;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** bytes that have been read */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde long read_length;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** how the request body should be read */
952908500d5f99f35afc5ed510391b9bdc3833farbb int read_body;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** reading chunked transfer-coding */
952908500d5f99f35afc5ed510391b9bdc3833farbb int read_chunked;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** is client waiting for a 100 response? */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde unsigned expecting_100;
952908500d5f99f35afc5ed510391b9bdc3833farbb
50cf9b8da68bea71ce5a49b4cb4be3be516486bdgstein /* MIME header environments, in and out. Also, an array containing
952908500d5f99f35afc5ed510391b9bdc3833farbb * environment variables to be passed to subprocesses, so people can
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * write modules to add to that environment.
3887202241db08986e94b252fbd06a55e55d4b2dbhyde *
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * The difference between headers_out and err_headers_out is that the
952908500d5f99f35afc5ed510391b9bdc3833farbb * latter are printed even on error, and persist across internal redirects
2d2eda71267231c2526be701fe655db125852c1ffielding * (so the headers printed for ErrorDocument handlers will have them).
952908500d5f99f35afc5ed510391b9bdc3833farbb *
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * The 'notes' apr_table_t is for notes from one module to another, with no
e57fd661645dcfdf166e77484b509b248e62a19eaaron * other set purpose in mind...
2d2eda71267231c2526be701fe655db125852c1ffielding */
e57fd661645dcfdf166e77484b509b248e62a19eaaron
2d2eda71267231c2526be701fe655db125852c1ffielding /** MIME header environment from the request */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_table_t *headers_in;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** MIME header environment for the response */
952908500d5f99f35afc5ed510391b9bdc3833farbb apr_table_t *headers_out;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** MIME header environment for the response, printed even on errors and
952908500d5f99f35afc5ed510391b9bdc3833farbb * persist across internal redirects */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_table_t *err_headers_out;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** Array of environment variables to be used for sub processes */
952908500d5f99f35afc5ed510391b9bdc3833farbb apr_table_t *subprocess_env;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Notes from one module to another */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_table_t *notes;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /* content_type, handler, content_encoding, content_language, and all
e57fd661645dcfdf166e77484b509b248e62a19eaaron * content_languages MUST be lowercased strings. They may be pointers
952908500d5f99f35afc5ed510391b9bdc3833farbb * to static strings; they should not be modified in place.
97ff7bf3f33a3527953d975df5cbf82a5a7dc9a6wrowe */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The content-type for the current request */
853a0c44563b056e40e9cffe911190f554e63ec3chuck const char *content_type; /* Break these out --- we dispatch on 'em */
79c0ed7d839527abd86794a6b1d2df4fd189a2a8jerenkrantz /** The handler string that we use to call a handler function */
79c0ed7d839527abd86794a6b1d2df4fd189a2a8jerenkrantz const char *handler; /* What we *really* dispatch on */
853a0c44563b056e40e9cffe911190f554e63ec3chuck
952908500d5f99f35afc5ed510391b9bdc3833farbb /** How to encode the data */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *content_encoding;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** for back-compat. only -- do not use */
e57fd661645dcfdf166e77484b509b248e62a19eaaron const char *content_language;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** array of (char*) representing the content languages */
e57fd661645dcfdf166e77484b509b248e62a19eaaron apr_array_header_t *content_languages;
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /** variant list validator (if negotiated) */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *vlist_validator;
952908500d5f99f35afc5ed510391b9bdc3833farbb
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** If an authentication check was made, this gets set to the user name. */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *user;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If an authentication check was made, this gets set to the auth type. */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *ap_auth_type;
952908500d5f99f35afc5ed510391b9bdc3833farbb
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** This response is non-cache-able */
952908500d5f99f35afc5ed510391b9bdc3833farbb int no_cache;
2d2eda71267231c2526be701fe655db125852c1ffielding /** There is no local copy of this response */
2d2eda71267231c2526be701fe655db125852c1ffielding int no_local_copy;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /* What object is being requested (either directly, or via include
2d2eda71267231c2526be701fe655db125852c1ffielding * or content-negotiation mapping).
e57fd661645dcfdf166e77484b509b248e62a19eaaron */
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the uri without any parsing performed */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *unparsed_uri;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the path portion of the URI */
9f9307bbe539dbcf96919715315eb64ce3465f5bben char *uri;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** The filename on disk that this response corresponds to */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *filename;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The path_info for this request if there is any. */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *path_info;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** QUERY_ARGS, if any */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *args;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** ST_MODE set to zero if no such file */
952908500d5f99f35afc5ed510391b9bdc3833farbb apr_finfo_t finfo;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** components of uri, dismantled */
952908500d5f99f35afc5ed510391b9bdc3833farbb uri_components parsed_uri;
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /* Various other config info which may change with .htaccess files
952908500d5f99f35afc5ed510391b9bdc3833farbb * These are config vectors, with one void* pointer for each module
952908500d5f99f35afc5ed510391b9bdc3833farbb * (the thing pointed to being the module's business).
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Options set in config files, etc. */
9f9307bbe539dbcf96919715315eb64ce3465f5bben void *per_dir_config;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Notes on *this* request */
62db15de4c1f335a64d45821796ae197cff94ef8rbb void *request_config;
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb/**
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb * a linked list of the configuration directives in the .htaccess files
a520b923984f45daeaf0741d5c7e3de1f2d24509rbb * accessed by this request.
2d2eda71267231c2526be701fe655db125852c1ffielding * N.B. always add to the head of the list, _never_ to the end.
952908500d5f99f35afc5ed510391b9bdc3833farbb * that way, a sub request's list can (temporarily) point to a parent's list
11a7b0dff22d26770b532c174d1cf2e7b56ec244wrowe * @defvar const htaccess_result *htaccess
952908500d5f99f35afc5ed510391b9bdc3833farbb */
11a7b0dff22d26770b532c174d1cf2e7b56ec244wrowe const struct htaccess_result *htaccess;
e57fd661645dcfdf166e77484b509b248e62a19eaaron
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifdef APACHE_XLATE
2d2eda71267231c2526be701fe655db125852c1ffielding /** The translation headers for dealing with this request
2d2eda71267231c2526be701fe655db125852c1ffielding * @defvar ap_rr_xlate *rrx */
2d2eda71267231c2526be701fe655db125852c1ffielding struct ap_rr_xlate *rrx;
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif /*APACHE_XLATE*/
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /** A list of filters to be used for this request
952908500d5f99f35afc5ed510391b9bdc3833farbb * @defvar ap_filter_t *filters */
952908500d5f99f35afc5ed510391b9bdc3833farbb struct ap_filter_t *filters;
7bdef86e15d47d16dcbe7a5611683191774bd5fbgstein int eos_sent;
952908500d5f99f35afc5ed510391b9bdc3833farbb
e57fd661645dcfdf166e77484b509b248e62a19eaaron/* Things placed at the end of the record to avoid breaking binary
11a7b0dff22d26770b532c174d1cf2e7b56ec244wrowe * compatibility. It would be nice to remember to reorder the entire
e57fd661645dcfdf166e77484b509b248e62a19eaaron * record to improve 64bit alignment the next time we need to break
11a7b0dff22d26770b532c174d1cf2e7b56ec244wrowe * binary compatibility for some other reason.
e57fd661645dcfdf166e77484b509b248e62a19eaaron */
e57fd661645dcfdf166e77484b509b248e62a19eaaron};
e57fd661645dcfdf166e77484b509b248e62a19eaaron
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/** Structure to store things which are per connection */
952908500d5f99f35afc5ed510391b9bdc3833farbbstruct conn_rec {
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Pool associated with this connection */
952908500d5f99f35afc5ed510391b9bdc3833farbb apr_pool_t *pool;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Physical vhost this conn come in on */
2d2eda71267231c2526be701fe655db125852c1ffielding server_rec *base_server;
2d2eda71267231c2526be701fe655db125852c1ffielding /** used by http_vhost.c */
2d2eda71267231c2526be701fe655db125852c1ffielding void *vhost_lookup_data;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /* Information about the connection itself */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /** Connection to the client */
2d2eda71267231c2526be701fe655db125852c1ffielding BUFF *client;
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm
2d2eda71267231c2526be701fe655db125852c1ffielding /* Who is the client? */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /** local address */
952908500d5f99f35afc5ed510391b9bdc3833farbb struct sockaddr_in local_addr;
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm /** remote address */
952908500d5f99f35afc5ed510391b9bdc3833farbb struct sockaddr_in remote_addr;
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm /** Client's IP address */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *remote_ip;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Client's DNS name, if known. NULL if DNS hasn't been checked,
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * "" if it has and no address was found. N.B. Only access this though
952908500d5f99f35afc5ed510391b9bdc3833farbb * get_remote_host() */
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm char *remote_host;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Only ever set if doing rfc1413 lookups. N.B. Only access this through
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * get_remote_logname() */
2d2eda71267231c2526be701fe655db125852c1ffielding char *remote_logname;
44a4ee1140769173da7bc2b42d1a686e3260ad84wrowe
44a4ee1140769173da7bc2b42d1a686e3260ad84wrowe /** Are we still talking? */
44a4ee1140769173da7bc2b42d1a686e3260ad84wrowe unsigned aborted:1;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Are we using HTTP Keep-Alive? -1 fatal error, 0 undecided, 1 yes */
952908500d5f99f35afc5ed510391b9bdc3833farbb signed int keepalive:2;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Did we use HTTP Keep-Alive? */
952908500d5f99f35afc5ed510391b9bdc3833farbb unsigned keptalive:1;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
2d2eda71267231c2526be701fe655db125852c1ffielding * 1 yes/success */
952908500d5f99f35afc5ed510391b9bdc3833farbb signed int double_reverse:2;
2d2eda71267231c2526be701fe655db125852c1ffielding
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** How many times have we used it? */
952908500d5f99f35afc5ed510391b9bdc3833farbb int keepalives;
2d2eda71267231c2526be701fe655db125852c1ffielding /** server IP address */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *local_ip;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** used for ap_get_server_name when UseCanonicalName is set to DNS
2e123e8beedc9f921448c113e2d6823a92fd5261fielding * (ignores setting of HostnameLookups) */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *local_host;
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb /** ID of this connection; unique at any point in time */
952908500d5f99f35afc5ed510391b9bdc3833farbb long id;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Notes on *this* connection */
e57fd661645dcfdf166e77484b509b248e62a19eaaron void *conn_config;
2d2eda71267231c2526be701fe655db125852c1ffielding /** send note from one module to another, must remain valid for all
952908500d5f99f35afc5ed510391b9bdc3833farbb * requests on this conn */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_table_t *notes;
2d2eda71267231c2526be701fe655db125852c1ffielding};
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* Per-vhost config... */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/* The address 255.255.255.255, when used as a virtualhost address,
e57fd661645dcfdf166e77484b509b248e62a19eaaron * will become the "default" server when the ip doesn't match other vhosts.
952908500d5f99f35afc5ed510391b9bdc3833farbb */
e57fd661645dcfdf166e77484b509b248e62a19eaaron#define DEFAULT_VHOST_ADDR 0xfffffffful
952908500d5f99f35afc5ed510391b9bdc3833farbb
e57fd661645dcfdf166e77484b509b248e62a19eaarontypedef struct server_addr_rec server_addr_rec;
2d2eda71267231c2526be701fe655db125852c1ffielding
e57fd661645dcfdf166e77484b509b248e62a19eaaron/** A structure to be used for Per-vhost config */
fa3785601cc3801525bc3fc98cafcea5d82efe99wrowestruct server_addr_rec {
a18775c154178d6c07aed84bd54ac16f59f89bc9wrowe /** The next server in the list */
e57fd661645dcfdf166e77484b509b248e62a19eaaron server_addr_rec *next;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The bound address, for this server */
e57fd661645dcfdf166e77484b509b248e62a19eaaron apr_in_addr host_addr;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The bound port, for this server */
952908500d5f99f35afc5ed510391b9bdc3833farbb unsigned short host_port;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The name given in <VirtualHost> */
e57fd661645dcfdf166e77484b509b248e62a19eaaron char *virthost;
8b99f2a316c5e2fa6ab208206fdd7fc2bfc4a921dougm};
2d2eda71267231c2526be701fe655db125852c1ffielding
e57fd661645dcfdf166e77484b509b248e62a19eaaron/** A structure to store information for each virtual server */
e57fd661645dcfdf166e77484b509b248e62a19eaaronstruct server_rec {
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** The process this server is running in */
e57fd661645dcfdf166e77484b509b248e62a19eaaron process_rec *process;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** The next server in the list */
e57fd661645dcfdf166e77484b509b248e62a19eaaron server_rec *next;
e57fd661645dcfdf166e77484b509b248e62a19eaaron
cd9eb79cfbf9bc730ccacc3a3774b1fe1b99ed53wrowe /** The name of the server */
97ff7bf3f33a3527953d975df5cbf82a5a7dc9a6wrowe const char *defn_name;
97ff7bf3f33a3527953d975df5cbf82a5a7dc9a6wrowe /** The line of the config file that the server was defined on */
2d2eda71267231c2526be701fe655db125852c1ffielding unsigned defn_line_number;
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /* Contact information */
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding /** The admin's contact information */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *server_admin;
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein /** The server hostname */
952908500d5f99f35afc5ed510391b9bdc3833farbb char *server_hostname;
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein /** for redirects, etc. */
2d2eda71267231c2526be701fe655db125852c1ffielding unsigned short port;
e57fd661645dcfdf166e77484b509b248e62a19eaaron
e57fd661645dcfdf166e77484b509b248e62a19eaaron /* Log files --- note that transfer log is now in the modules... */
e57fd661645dcfdf166e77484b509b248e62a19eaaron
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** The name of the error log */
e57fd661645dcfdf166e77484b509b248e62a19eaaron char *error_fname;
e57fd661645dcfdf166e77484b509b248e62a19eaaron /** A file descriptor that references the error log */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_file_t *error_log;
2d2eda71267231c2526be701fe655db125852c1ffielding /** The log level for this server */
9f9307bbe539dbcf96919715315eb64ce3465f5bben int loglevel;
4b86db47932a21da10cd35317b3da737f2b073c4rbb
9f9307bbe539dbcf96919715315eb64ce3465f5bben /* Module-specific configuration for server, and defaults... */
5fac642ef2ee110540c3a391e4cf1d166ba57d0ftrawick
e57e920838f31508f1418aa4c25ce55b345b2cebrbb /** true if this is the virtual server */
e57e920838f31508f1418aa4c25ce55b345b2cebrbb int is_virtual;
e57e920838f31508f1418aa4c25ce55b345b2cebrbb /** Config vector containing pointers to modules' per-server config
e57e920838f31508f1418aa4c25ce55b345b2cebrbb * structures. */
e57e920838f31508f1418aa4c25ce55b345b2cebrbb void *module_config;
e57e920838f31508f1418aa4c25ce55b345b2cebrbb /** MIME type info, etc., before we start checking per-directory info */
e57e920838f31508f1418aa4c25ce55b345b2cebrbb void *lookup_defaults;
e57e920838f31508f1418aa4c25ce55b345b2cebrbb
9f9307bbe539dbcf96919715315eb64ce3465f5bben /* Transaction handling */
da76b1004afd7a8785684c84e4d4b5c893c65572rbb
777a2b42697cb8cb94ac4e73774862f879259c45rbb /** I haven't got a clue */
2d2eda71267231c2526be701fe655db125852c1ffielding server_addr_rec *addrs;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Timeout, in seconds, before we give up */
2d2eda71267231c2526be701fe655db125852c1ffielding int timeout;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Seconds we'll wait for another request */
2d2eda71267231c2526be701fe655db125852c1ffielding int keep_alive_timeout;
2d2eda71267231c2526be701fe655db125852c1ffielding /** Maximum requests per connection */
2d2eda71267231c2526be701fe655db125852c1ffielding int keep_alive_max;
9f9307bbe539dbcf96919715315eb64ce3465f5bben /** Use persistent connections? */
9f9307bbe539dbcf96919715315eb64ce3465f5bben int keep_alive;
9f9307bbe539dbcf96919715315eb64ce3465f5bben
9f9307bbe539dbcf96919715315eb64ce3465f5bben /** Pathname for ServerPath */
853a0c44563b056e40e9cffe911190f554e63ec3chuck const char *path;
853a0c44563b056e40e9cffe911190f554e63ec3chuck /** Length of path */
853a0c44563b056e40e9cffe911190f554e63ec3chuck int pathlen;
9f9307bbe539dbcf96919715315eb64ce3465f5bben
853a0c44563b056e40e9cffe911190f554e63ec3chuck /** Normal names for ServerAlias servers */
853a0c44563b056e40e9cffe911190f554e63ec3chuck apr_array_header_t *names;
9f9307bbe539dbcf96919715315eb64ce3465f5bben /** Wildcarded names for ServerAlias servers */
9f9307bbe539dbcf96919715315eb64ce3465f5bben apr_array_header_t *wild_names;
9f9307bbe539dbcf96919715315eb64ce3465f5bben
79c0ed7d839527abd86794a6b1d2df4fd189a2a8jerenkrantz /** effective user id when calling exec wrapper */
9f9307bbe539dbcf96919715315eb64ce3465f5bben uid_t server_uid;
9f9307bbe539dbcf96919715315eb64ce3465f5bben /** effective group id when calling exec wrapper */
853a0c44563b056e40e9cffe911190f554e63ec3chuck gid_t server_gid;
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz /** limit on size of the HTTP request line */
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz int limit_req_line;
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz /** limit on size of any request header field */
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz int limit_req_fieldsize;
2d2eda71267231c2526be701fe655db125852c1ffielding /** limit on number of request header fields */
952908500d5f99f35afc5ed510391b9bdc3833farbb int limit_req_fields;
2d2eda71267231c2526be701fe655db125852c1ffielding};
952908500d5f99f35afc5ed510391b9bdc3833farbb
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm/* stuff marked API_EXPORT is part of the API, and intended for use
be8a31a0afdb2363dbcc98bbbaa94b6184061b5fdreid * by modules
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef API_EXPORT
952908500d5f99f35afc5ed510391b9bdc3833farbb#define API_EXPORT(type) type
2d2eda71267231c2526be701fe655db125852c1ffielding#endif
2d2eda71267231c2526be701fe655db125852c1ffielding
952908500d5f99f35afc5ed510391b9bdc3833farbb/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
91644a5f4d3e992dc208304b50e80bbb236fca89trawick * use by modules. The difference between API_EXPORT and
952908500d5f99f35afc5ed510391b9bdc3833farbb * API_EXPORT_NONSTD is that the latter is required for any functions
91644a5f4d3e992dc208304b50e80bbb236fca89trawick * which use varargs or are used via indirect function call. This
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * is to accomodate the two calling conventions in windows dlls.
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef API_EXPORT_NONSTD
952908500d5f99f35afc5ed510391b9bdc3833farbb#define API_EXPORT_NONSTD(type) type
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef MODULE_VAR_EXPORT
952908500d5f99f35afc5ed510391b9bdc3833farbb#define MODULE_VAR_EXPORT
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef API_VAR_EXPORT
952908500d5f99f35afc5ed510391b9bdc3833farbb#define API_VAR_EXPORT
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb
8019a211b7453e80e6e22db6d41fe68dd7f8c4b8fielding/* modules should not used functions marked CORE_EXPORT
8019a211b7453e80e6e22db6d41fe68dd7f8c4b8fielding * or CORE_EXPORT_NONSTD */
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz#ifndef CORE_EXPORT
f9a773d26994c3b267589e404cdb5b760f83e888jerenkrantz#define CORE_EXPORT API_EXPORT
8019a211b7453e80e6e22db6d41fe68dd7f8c4b8fielding#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef CORE_EXPORT_NONSTD
952908500d5f99f35afc5ed510391b9bdc3833farbb#define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb
ae2f0a4a94a833fd44cb6b5c1f520cbc76ff72fefielding/* On Mac OS X Server, symbols that conflict with loaded dylibs
ae2f0a4a94a833fd44cb6b5c1f520cbc76ff72fefielding * (eg. System framework) need to be declared as private symbols with
952908500d5f99f35afc5ed510391b9bdc3833farbb * __private_extern__.
952908500d5f99f35afc5ed510391b9bdc3833farbb * For other systems, make that a no-op.
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbb#ifndef ap_private_extern
952908500d5f99f35afc5ed510391b9bdc3833farbb#if (defined(MAC_OS) || defined(MAC_OS_X_SERVER)) && defined(__DYNAMIC__)
952908500d5f99f35afc5ed510391b9bdc3833farbb#define ap_private_extern __private_extern__
952908500d5f99f35afc5ed510391b9bdc3833farbb#else
952908500d5f99f35afc5ed510391b9bdc3833farbb#define ap_private_extern
952908500d5f99f35afc5ed510391b9bdc3833farbb#endif
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein#endif
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Examine a field value (such as a media-/content-type) string and return
9f9307bbe539dbcf96919715315eb64ce3465f5bben * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
1296b2d30150ccb4ae9f6d690846b4e8f8571fd2rbb * @param p Pool to allocate memory out of
9f9307bbe539dbcf96919715315eb64ce3465f5bben * @param intype The field to examine
c43223fef00e5fa98a54c37a21175ff788b76f43rbb * @return the field minus any parameters
ca47a2b6bcea23e8af185c68f256dcbbfd2a0f9dtrawick * @deffunc char *ap_field_noparam(apr_pool_t *p, const char *intype);
ca47a2b6bcea23e8af185c68f256dcbbfd2a0f9dtrawick */
2fc50921b88defeb7127985dfe4b4130175e069ejwoolleyAPI_EXPORT(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
2fc50921b88defeb7127985dfe4b4130175e069ejwoolley
2d2eda71267231c2526be701fe655db125852c1ffielding/**
2d2eda71267231c2526be701fe655db125852c1ffielding * Convert a time from an integer into a string in a specified format
2d2eda71267231c2526be701fe655db125852c1ffielding * @param p The pool to allocate memory out of
2d2eda71267231c2526be701fe655db125852c1ffielding * @param t The time to convert
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * @param fmt The format to use for the conversion
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh * @param gmt Convert the time for GMT?
2d2eda71267231c2526be701fe655db125852c1ffielding * @return The string that represents the specified time
2d2eda71267231c2526be701fe655db125852c1ffielding * @deffunc char *ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt)
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/* String handling. The *_nc variants allow you to use non-const char **s as
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh arguments (unfortunately C won't automatically convert a char ** to a const
2d2eda71267231c2526be701fe655db125852c1ffielding char **) */
169f62b04de69074b561b4e6dcf6f82572a5e367trawick
2d2eda71267231c2526be701fe655db125852c1ffielding/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the characters until the first occurance of a specified character
8a261a9f7d18d1e862d63f68e93f288d3e1f0d94trawick * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The string to get the characters from
dad234382d8424e1c5a30af2838e172aec9d6d1bdreid * @param stop The character to stop at
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the characters up to the first stop character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword(apr_pool_t *p, const char **line, char stop);
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
2d2eda71267231c2526be701fe655db125852c1ffielding * Get the characters until the first occurance of a specified character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * @param line The string to get the characters from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to stop at
2d2eda71267231c2526be701fe655db125852c1ffielding * @return A copy of the characters up to the first stop character
2d2eda71267231c2526be701fe655db125852c1ffielding * @tip This is the same as ap_getword, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_nc(apr_pool_t *p, char **line, char stop);
2d2eda71267231c2526be701fe655db125852c1ffielding */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/**
2d2eda71267231c2526be701fe655db125852c1ffielding * Get the first word from a given string. A word is defined as all characters
2d2eda71267231c2526be701fe655db125852c1ffielding * up to the first whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory from
2d2eda71267231c2526be701fe655db125852c1ffielding * @param line The string to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @retrn The first word in the line
2d2eda71267231c2526be701fe655db125852c1ffielding * @deffunc char *ap_getword_white(apr_pool_t *p, const char **line)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
dad234382d8424e1c5a30af2838e172aec9d6d1bdreidAPI_EXPORT(char *) ap_getword_white(apr_pool_t *p, const char **line);
2d2eda71267231c2526be701fe655db125852c1ffielding/**
2d2eda71267231c2526be701fe655db125852c1ffielding * Get the first word from a given string. A word is defined as all characters
2d2eda71267231c2526be701fe655db125852c1ffielding * up to the first whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory from
2d2eda71267231c2526be701fe655db125852c1ffielding * @param line The string to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @retrn The first word in the line
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * @tip The same as ap_getword_white, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_white_nc(apr_pool_t *p, const char **line)
2d2eda71267231c2526be701fe655db125852c1ffielding */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
2d2eda71267231c2526be701fe655db125852c1ffielding
2d2eda71267231c2526be701fe655db125852c1ffielding/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get all characters from the first occurance of stop to the first '\0'
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to start at
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein * @return A copy of all caracters after the first occurance of the specified
169f62b04de69074b561b4e6dcf6f82572a5e367trawick * character
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein * @deffunc char *ap_getword_nulls(apr_pool_t *p, const char **line, char stop)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_getword_nulls(apr_pool_t *p, const char **line, char stop);
2d2eda71267231c2526be701fe655db125852c1ffielding/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get all characters from the first occurance of stop to the first '\0'
2d2eda71267231c2526be701fe655db125852c1ffielding * @param p The pool to allocate memory out of
fa861fc5a880d2c3a5ecc0ec71fa7da556adf5c1wrowe * @param line The line to traverse
fa861fc5a880d2c3a5ecc0ec71fa7da556adf5c1wrowe * @param stop The character to start at
fa861fc5a880d2c3a5ecc0ec71fa7da556adf5c1wrowe * @return A copy of all caracters after the first occurance of the specified
fa861fc5a880d2c3a5ecc0ec71fa7da556adf5c1wrowe * character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip The same as ap_getword_nulls, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the second word in the string paying attention to quoting
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_conf(apr_pool_t *p, const char **line)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_getword_conf(apr_pool_t *p, const char **line);
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the second word in the string paying attention to quoting
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip The same as ap_getword_conf, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_conf_nc(apr_pool_t *p, char **line)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
2d2eda71267231c2526be701fe655db125852c1ffielding
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb/**
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * Check a string for any ${ENV} environment variable construct and replace
2221ad59a355f17a27727dd12cfa14fdae87975agregames * each them by the value of that environment variable, if it exists. If the
2221ad59a355f17a27727dd12cfa14fdae87975agregames * environment value does not exist, leave the ${ENV} construct alone; it
2221ad59a355f17a27727dd12cfa14fdae87975agregames * means something else.
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * @param p The pool to allocate out of
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * @param word The string to check
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * @return The string with the replaced environment variables
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb * @deffunc const char *ap_resolve_env(apr_pool_t *p, const char *word)
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb */
4fbb89a070c82e489830233bde6bc78ddf179978stoddardAPI_EXPORT(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
4fbb89a070c82e489830233bde6bc78ddf179978stoddard
4fbb89a070c82e489830233bde6bc78ddf179978stoddard/**
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * Size an HTTP header field list item, as separated by a comma.
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * @param field The field to size
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * @param len The length of the field
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * @return The return value is a pointer to the beginning of the non-empty
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * list item within the original string (or NULL if there is none) and the
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * address of field is shifted to the next non-comma, non-whitespace
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * character. len is the length of the item excluding any beginning whitespace.
4fbb89a070c82e489830233bde6bc78ddf179978stoddard * @deffunc const char *ap_size_list_item(const char **field, int *len)
e6cc28a5eb3371ba0c38e941855e71ff0054f50erbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(const char *) ap_size_list_item(const char **field, int *len);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Retrieve an HTTP header field list item, as separated by a comma,
952908500d5f99f35afc5ed510391b9bdc3833farbb * while stripping insignificant whitespace and lowercasing anything not in
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * a quoted string or comment.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param field The field to retrieve
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The return value is a new string containing the converted list
952908500d5f99f35afc5ed510391b9bdc3833farbb * item (or NULL if none) and the address pointed to by field is
952908500d5f99f35afc5ed510391b9bdc3833farbb * shifted to the next non-comma, non-whitespace.
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc char *ap_get_list_item(apr_pool_t *p, const char **field)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_get_list_item(apr_pool_t *p, const char **field);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Find an item in canonical form (lowercase, no extra spaces) within
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * an HTTP field value list.
2d2eda71267231c2526be701fe655db125852c1ffielding * @param p The pool to allocate out of
2d2eda71267231c2526be701fe655db125852c1ffielding * @param line The field value list to search
2d2eda71267231c2526be701fe655db125852c1ffielding * @param tok The token to search for
2d2eda71267231c2526be701fe655db125852c1ffielding * @return 1 if found, 0 if not found.
2d2eda71267231c2526be701fe655db125852c1ffielding * @deffunc int ap_find_list_item(apr_pool_t *p, const char *line, const char *tok)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Retrieve a token, spacing over it and returning a pointer to
952908500d5f99f35afc5ed510391b9bdc3833farbb * the first non-white byte afterwards. Note that these tokens
952908500d5f99f35afc5ed510391b9bdc3833farbb * are delimited by semis and commas; and can also be delimited
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * by whitespace at the caller's option.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param accept_line The line to retrieve the token from
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param accept_white Is it delimited by whitespace
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return the first non-white byte after the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
952908500d5f99f35afc5ed510391b9bdc3833farbb
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * find http tokens, see the definition of token from RFC2068
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to find the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param tok The token to find
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the token is found, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_find_token(apr_pool_t *p, const char *line, const char *tok)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * find http tokens from the end of the line
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to find the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param tok The token to find
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return 1 if the token is found, 0 otherwise
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc int ap_find_last_token(apr_pool_t *p, const char *line, const char *tok)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
3d96ee83babeec32482c9082c9426340cee8c44dwroweAPI_EXPORT(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Check for an Absolute URI syntax
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param u The string to check
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if URI, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_is_url(const char *u)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_is_url(const char *u);
952908500d5f99f35afc5ed510391b9bdc3833farbb
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Unescape a URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param url The url to unescapte
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return 0 on success, non-zero otherwise
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc int ap_unescape_url(char *url)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_unescape_url(char *url);
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Remove all double slashes from a string
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param name The string to parse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc void ap_no2slash(char *name)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(void) ap_no2slash(char *name);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Remove all ./ and ../ substrings from a file name
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param name the file name to parse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc void ap_getparents(char *name)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
3d96ee83babeec32482c9082c9426340cee8c44dwroweAPI_EXPORT(void) ap_getparents(char *name);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Escape a path segment, as defined in RFC 1808
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The path to convert
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return The converted URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_escape_path_segment(apr_pool_t *p, const char *s)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * convert an OS path to a URL in an OS dependant way.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param path The path to convert
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param partial if set, assume that the path will be appended to something
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * with a '/' in it (and thus does not prefix "./")
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The converted URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
3d96ee83babeec32482c9082c9426340cee8c44dwroweAPI_EXPORT(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Escape an html string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The html to escape
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The escaped string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_escape_html(apr_pool_t *p, const char *s)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_escape_html(apr_pool_t *p, const char *s);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Construct a full hostname
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param hostname The hostname of the server
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param port The port the server is running on
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param r The current request
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The server's hostname
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, unsiged port, const request_rec *r)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
952908500d5f99f35afc5ed510391b9bdc3833farbb unsigned port, const request_rec *r);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Escape a shell command
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The command to escape
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The escaped hostname
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc char *ap_escape_shell_cmd(apr_pool_t *p, const char *s)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * Count the number of directories in a path
2d2eda71267231c2526be701fe655db125852c1ffielding * @param The path to count
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The number of directories
971ced4989415d939afba8d70c82a9ce0113bceend * @deffunc int ap_count_dirs(const char *path)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(int) ap_count_dirs(const char *path);
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * copy at most n leading directories of s into d d should be at least as
971ced4989415d939afba8d70c82a9ce0113bceend * large as s plus 1 extra byte assumes n > 0
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param d The location to copy to
971ced4989415d939afba8d70c82a9ce0113bceend * @param s The location to copy from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param n The number of directories to copy
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @return value is the ever useful pointer to the trailing \0 of d
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_make_dirstr_prefix(char *d, const char *s, int n)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * return the parent directory name including trailing / of the file s
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The file to get the parent of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the file's parent directory
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @deffunc char *ap_make_dirstr_parent(apr_pool_t *p, const char *s)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Given a directory and filename, create a single path out of them. This
952908500d5f99f35afc5ed510391b9bdc3833farbb * function is smart enough to ensure that there is a sinlge '/' between the
952908500d5f99f35afc5ed510391b9bdc3833farbb * directory and file names
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param a The pool to allocate out of
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param dir The directory name
2d2eda71267231c2526be701fe655db125852c1ffielding * @param f The filename
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the full path
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_make_full_path(apr_pool_t *a, const char *dir, const char *f)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
952908500d5f99f35afc5ed510391b9bdc3833farbb
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Does the provided string contain wildcard characters? This is useful
952908500d5f99f35afc5ed510391b9bdc3833farbb * for determining if the string should be passed to strcmp_match or to strcmp.
952908500d5f99f35afc5ed510391b9bdc3833farbb * The only wildcard characters recognized are '?' and '*'
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar * @param str The string to check
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the string has wildcards, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_is_matchexp(const char *str)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarAPI_EXPORT(int) ap_is_matchexp(const char *str);
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar/**
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar * Determine if a string matches a patterm containing the wildcards '?' or '*'
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar * @param str The string to check
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar * @param exp The pattern to match against
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the two strings match, 0 otherwise
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc int ap_strcmp_match(const char *str, const char *exp)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Determine if a string matches a patterm containing the wildcards '?' or '*',
952908500d5f99f35afc5ed510391b9bdc3833farbb * ignoring case
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param str The string to check
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param exp The pattern to match against
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the two strings match, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_strcasecmp_match(const char *str, const char *exp)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Find the first occurrence of the substring s2 in s1, regardless of case
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s1 The string to search
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s2 The substring to search for
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A pointer to the beginning of the substring
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @deffunc char *ap_strcasestr(const char *s1, const char *s2)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Decode a base64 encoded string into memory allocated out of a pool
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param bufcoded The encoded string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The decoded string
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @deffunc char *ap_pbase64decode(apr_pool_t *p, const char *bufcoded)
3d0bdf16bc410722e6c42aa2ceb0677b0ae29b90ianh */
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
952908500d5f99f35afc5ed510391b9bdc3833farbb
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Encode a string into memory allocated out of a pool in base 64 format
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param strin The plaintext string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The encoded string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_pbase64encode(apr_pool_t *p, char *string)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(char *) ap_pbase64encode(apr_pool_t *p, char *string);
3de8d8649277a02f53aa4f06121420985e8eee08nd
3de8d8649277a02f53aa4f06121420985e8eee08nd/* The functions have been deprecated for the two above functions.
3de8d8649277a02f53aa4f06121420985e8eee08nd */
3de8d8649277a02f53aa4f06121420985e8eee08ndAPI_EXPORT(char *) ap_uudecode(apr_pool_t *p, const char *bufcoded);
3de8d8649277a02f53aa4f06121420985e8eee08ndAPI_EXPORT(char *) ap_uuencode(apr_pool_t *p, char *string);
3de8d8649277a02f53aa4f06121420985e8eee08nd
3de8d8649277a02f53aa4f06121420985e8eee08nd#include "pcreposix.h"
3de8d8649277a02f53aa4f06121420985e8eee08nd
952908500d5f99f35afc5ed510391b9bdc3833farbb/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Compile a regular expression to be used later
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param pattern the regular expression to compile
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param cflags The bitwise or of one or more of the following:
952908500d5f99f35afc5ed510391b9bdc3833farbb * <PRE>
952908500d5f99f35afc5ed510391b9bdc3833farbb * REG_EXTENDED - Use POSIX extended Regular Expressions
952908500d5f99f35afc5ed510391b9bdc3833farbb * REG_ICASE - Ignore case
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * REG_NOSUB - Support for substring addressing of matches not required
dad234382d8424e1c5a30af2838e172aec9d6d1bdreid * REG_NEWLINE - Match-any-character operators don't match new-line
952908500d5f99f35afc5ed510391b9bdc3833farbb * </PRE>
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The compiled regular expression
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc regex_t *ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
952908500d5f99f35afc5ed510391b9bdc3833farbb int cflags);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/**
2d2eda71267231c2526be701fe655db125852c1ffielding * Free the memory associated with a compiled regular expression
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool the regex was allocated out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param reg The regular expression to free
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc void ap_pregfree(apr_pool_t *p, regex_t *reg)
952908500d5f99f35afc5ed510391b9bdc3833farbb */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(void) ap_pregfree(apr_pool_t *p, regex_t *reg);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe
7c7372abe2484e7fcf81937b93496d1246e5b816gstein/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Match a null-terminated string against a pre-compiled regex.
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param preg The pre-compiled regex
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param string The string to match
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param nmatch Provide information regarding the location of any matches
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param pmatch Provide information regarding the location of any matches
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param eflags Bitwise or of one or both of:
952908500d5f99f35afc5ed510391b9bdc3833farbb * <PRE>
952908500d5f99f35afc5ed510391b9bdc3833farbb * REG_NOTBOL - match-beginning-of-line operator always fails to match
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * REG_NOTEOL - match-end-of-line operator always fails to match
59ae852bea7d507f61999f982ded8219d2c0ec15wrowe * </PRE>
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return 0 for successful match, REG_NOMATCH otherwise
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @deffunc int ap_regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)
7c7372abe2484e7fcf81937b93496d1246e5b816gstein */
952908500d5f99f35afc5ed510391b9bdc3833farbbAPI_EXPORT(int) ap_regexec(regex_t *preg, const char *string,
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben size_t nmatch, regmatch_t pmatch[], int eflags);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/**
952908500d5f99f35afc5ed510391b9bdc3833farbb * Return the error code returned by regcomp or regexec into error messages
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param errocode the error code returned by regexec or regcomp
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param preg The precompiled regex
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param errbuf A buffer to store the error in
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param errbuf_size The size of the buffer
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc size_t ap_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(size_t) ap_regerror(int errcode, const regex_t *preg,
58619148951981bcfa5c506ad8ce745aa8831980rbb char *errbuf, size_t errbuf_size);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * After performing a successful regex match, you may use this function to
58619148951981bcfa5c506ad8ce745aa8831980rbb * perform a series of string substitutions based on subexpressions that were
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * matched during the call to ap_regexec
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * @param p The pool to allocate out of
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * @param input An arbitrary string containing $1 through $9. These are
58619148951981bcfa5c506ad8ce745aa8831980rbb * replaced with the corresponding matched sub-expressions
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param source The string that was originally matched to the regex
2d2eda71267231c2526be701fe655db125852c1ffielding * @param nmatch the nmatch returned from ap_pregex
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * @param pmatch the pmatch array returned from ap_pregex
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * @deffunc char *ap_pregsub(apr_pool_t *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[])
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe */
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wroweAPI_EXPORT(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe size_t nmatch, regmatch_t pmatch[]);
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe/**
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * we want to downcase the type/subtype for comparison purposes
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * but nothing else because ;parameter=foo values are case sensitive.
3d72602d1d9e6f0d49d20f0d0a71831c160ef589wrowe * @param s The content-type to convert to lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_content_type_tolower(char *s)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(void) ap_content_type_tolower(char *s);
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * convert a string to all lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param s The string to convert to lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_str_tolower(char *s)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(void) ap_str_tolower(char *s);
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Search a string from left to right for the first occurrence of a
92d6e181c597b97647d750c43a7bc3626e056b59gstein * specific character
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to search
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param c The character to search for
92d6e181c597b97647d750c43a7bc3626e056b59gstein * @return The index of the first occurrence of c in str
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_ind(const char *str, char c)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(int) ap_ind(const char *str, char c); /* Sigh... */
58619148951981bcfa5c506ad8ce745aa8831980rbb
92d6e181c597b97647d750c43a7bc3626e056b59gstein/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Search a string from right to left for the first occurrence of a
58619148951981bcfa5c506ad8ce745aa8831980rbb * specific character
92d6e181c597b97647d750c43a7bc3626e056b59gstein * @param str The string to search
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param c The character to search for
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The index of the first occurrence of c in str
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_rind(const char *str, char c)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(int) ap_rind(const char *str, char c);
58619148951981bcfa5c506ad8ce745aa8831980rbb
3e0494829cf6e8ac61e80fd82b1133111a52614cbrianp/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given a string, replace any bare " with \" .
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param p The pool to allocate memory out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param instring The string to search for "
30c095035b1d5910cc239a1384c816aef228beb5jim * @return A copy of the string with escaped quotes
30c095035b1d5910cc239a1384c816aef228beb5jim * @deffunc char * ap_escape_quotes(apr_pool_t *p, const char *instring)
30c095035b1d5910cc239a1384c816aef228beb5jim */
30c095035b1d5910cc239a1384c816aef228beb5jimAPI_EXPORT(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
30c095035b1d5910cc239a1384c816aef228beb5jim
30c095035b1d5910cc239a1384c816aef228beb5jim/* Misc system hackery */
bdadc326446cae4a51bf75811fbe01a3a362df64gstein/**
bdadc326446cae4a51bf75811fbe01a3a362df64gstein * Convert a username to a numeric ID
30c095035b1d5910cc239a1384c816aef228beb5jim * @param name The name to convert
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The user id corresponding to a name
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @deffunc uid_t ap_uname2id(const char *name)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(uid_t) ap_uname2id(const char *name);
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Convert a group name to a numeric ID
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param name The name to convert
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The group id corresponding to a name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc gid_t ap_gname2id(const char *name)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(gid_t) ap_gname2id(const char *name);
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given the name of an object in the file system determine if it is a directory
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param name The name of the object to check
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @return 1 if it is a directory, 0 otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_is_directory(const char *name)
2d2eda71267231c2526be701fe655db125852c1ffielding */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(int) ap_is_directory(const char *name);
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Given a pathname in file, extract the directory and chdir to that directory
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param file The file who's directory we wish to switch to
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_chdir_file(const char *file)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benAPI_EXPORT(void) ap_chdir_file(const char *file);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Get the maximum number of daemons processes for this version of Apache
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return The maximum number of daemon processes
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_get_max_daemons(void)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
3d96ee83babeec32482c9082c9426340cee8c44dwroweAPI_EXPORT(int) ap_get_max_daemons(void);
ffba30a2a49b298bfa65151bdf61ce3e3d4636d1manoj
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#ifdef _OSD_POSIX
58619148951981bcfa5c506ad8ce745aa8831980rbbextern const char *os_set_account(apr_pool_t *p, const char *account);
58619148951981bcfa5c506ad8ce745aa8831980rbbextern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#endif /* _OSD_POSIX */
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * determine the local host name for the current machine
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return A copy of the local host name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_get_local_host(apr_pool_t *p)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbbchar *ap_get_local_host(apr_pool_t *p);
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * Parses a host of the form <address>[:port] :port is permitted if 'port'
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * is not NULL
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param hostname The hostname to parse
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @param port The port found in the hostname
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben * @return The address of the server
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc unsigned long ap_get_virthost_addr(char *hostname, unsigned shor *port)
3d96ee83babeec32482c9082c9426340cee8c44dwrowe */
2d2eda71267231c2526be701fe655db125852c1ffieldingunsigned long ap_get_virthost_addr(char *hostname, unsigned short *port);
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb/*
58619148951981bcfa5c506ad8ce745aa8831980rbb * Redefine assert() to something more useful for an Apache...
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben */
58619148951981bcfa5c506ad8ce745aa8831980rbb/**
58619148951981bcfa5c506ad8ce745aa8831980rbb * Log an assertion to the error log
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param szExp The assertion that failed
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param szFile The file the assertion is in
3d96ee83babeec32482c9082c9426340cee8c44dwrowe * @param nLine The line the assertion is defined on
2d2eda71267231c2526be701fe655db125852c1ffielding * @deffunc void ap_log_assert(const char *szExp, const char *szFile, int nLine)
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
58619148951981bcfa5c506ad8ce745aa8831980rbb __attribute__((noreturn));
58619148951981bcfa5c506ad8ce745aa8831980rbb#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
58619148951981bcfa5c506ad8ce745aa8831980rbb
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben/* A set of flags which indicate places where the server should raise(SIGSTOP).
58619148951981bcfa5c506ad8ce745aa8831980rbb * This is useful for debugging, because you can then attach to that process
58619148951981bcfa5c506ad8ce745aa8831980rbb * with gdb and continue. This is important in cases where one_process
58619148951981bcfa5c506ad8ce745aa8831980rbb * debugging isn't possible.
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbb#define SIGSTOP_DETACH 1
58619148951981bcfa5c506ad8ce745aa8831980rbb#define SIGSTOP_MAKE_CHILD 2
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#define SIGSTOP_SPAWN_CHILD 4
2d2eda71267231c2526be701fe655db125852c1ffielding#define SIGSTOP_PIPED_LOG_SPAWN 8
2d2eda71267231c2526be701fe655db125852c1ffielding#define SIGSTOP_CGI_CHILD 16
58619148951981bcfa5c506ad8ce745aa8831980rbb
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben#ifdef DEBUG_SIGSTOP
58619148951981bcfa5c506ad8ce745aa8831980rbbextern int raise_sigstop_flags;
58619148951981bcfa5c506ad8ce745aa8831980rbb#define RAISE_SIGSTOP(x) do { \
58619148951981bcfa5c506ad8ce745aa8831980rbb if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
3d96ee83babeec32482c9082c9426340cee8c44dwrowe } while (0)
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#else
58619148951981bcfa5c506ad8ce745aa8831980rbb#define RAISE_SIGSTOP(x)
58619148951981bcfa5c506ad8ce745aa8831980rbb#endif
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe
58619148951981bcfa5c506ad8ce745aa8831980rbb/* strtoul does not exist on sunos4. */
58619148951981bcfa5c506ad8ce745aa8831980rbb#ifdef strtoul
58619148951981bcfa5c506ad8ce745aa8831980rbb#undef strtoul
58619148951981bcfa5c506ad8ce745aa8831980rbb#endif
58619148951981bcfa5c506ad8ce745aa8831980rbb#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb /* The C library has functions that allow const to be silently dropped ...
58619148951981bcfa5c506ad8ce745aa8831980rbb these macros detect the drop in maintainer mode, but use the native
3d96ee83babeec32482c9082c9426340cee8c44dwrowe methods far narmal builds
58619148951981bcfa5c506ad8ce745aa8831980rbb */
58619148951981bcfa5c506ad8ce745aa8831980rbb#ifdef AP_DEBUG
58619148951981bcfa5c506ad8ce745aa8831980rbb
58619148951981bcfa5c506ad8ce745aa8831980rbb#undef strchr
58619148951981bcfa5c506ad8ce745aa8831980rbb# define strchr(s, c) ap_strchr(s,c)
58619148951981bcfa5c506ad8ce745aa8831980rbb#undef strrchr
58619148951981bcfa5c506ad8ce745aa8831980rbb# define strrchr(s, c) ap_strrchr(s,c)
58619148951981bcfa5c506ad8ce745aa8831980rbb#undef strstr
3d96ee83babeec32482c9082c9426340cee8c44dwrowe# define strstr(s, c) ap_strstr(s,c)
2d2eda71267231c2526be701fe655db125852c1ffielding
58619148951981bcfa5c506ad8ce745aa8831980rbbchar *ap_strchr(char *s, int c);
58619148951981bcfa5c506ad8ce745aa8831980rbbconst char *ap_strchr_c(const char *s, int c);
759f4a24d09e28c4eaca9f97311b497fc15cb5c7benchar *ap_strrchr(char *s, int c);
58619148951981bcfa5c506ad8ce745aa8831980rbbconst char *ap_strrchr_c(const char *s, int c);
58619148951981bcfa5c506ad8ce745aa8831980rbbchar *ap_strstr(char *s, char *c);
58619148951981bcfa5c506ad8ce745aa8831980rbbconst char *ap_strstr_c(const char *s, const char *c);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe
2d2eda71267231c2526be701fe655db125852c1ffielding#else
2d2eda71267231c2526be701fe655db125852c1ffielding
58619148951981bcfa5c506ad8ce745aa8831980rbb# define ap_strchr(s, c) strchr(s, c)
58619148951981bcfa5c506ad8ce745aa8831980rbb# define ap_strchr_c(s, c) strchr(s, c)
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben# define ap_strrchr(s, c) strrchr(s, c)
58619148951981bcfa5c506ad8ce745aa8831980rbb# define ap_strrchr_c(s, c) strrchr(s, c)
58619148951981bcfa5c506ad8ce745aa8831980rbb# define ap_strstr(s, c) strstr(s, c)
30c095035b1d5910cc239a1384c816aef228beb5jim# define ap_strstr_c(s, c) strstr(s, c)
47ab8dcf8ad581569376f2e04ef16bc785bb122aake
7c7372abe2484e7fcf81937b93496d1246e5b816gstein#endif
30c095035b1d5910cc239a1384c816aef228beb5jim
30c095035b1d5910cc239a1384c816aef228beb5jim#ifdef __cplusplus
759f4a24d09e28c4eaca9f97311b497fc15cb5c7ben}
30c095035b1d5910cc239a1384c816aef228beb5jim#endif
30c095035b1d5910cc239a1384c816aef228beb5jim
58619148951981bcfa5c506ad8ce745aa8831980rbb#endif /* !APACHE_HTTPD_H */
47ab8dcf8ad581569376f2e04ef16bc785bb122aake