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