httpd.h revision 439ccf2a084e1da566548931c585cbcc3a9e7f4c
97a9a944b5887e91042b019776c41d5dd74557aferikabele/* Licensed to the Apache Software Foundation (ASF) under one or more
97a9a944b5887e91042b019776c41d5dd74557aferikabele * contributor license agreements. See the NOTICE file distributed with
97a9a944b5887e91042b019776c41d5dd74557aferikabele * this work for additional information regarding copyright ownership.
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * The ASF licenses this file to You under the Apache License, Version 2.0
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * (the "License"); you may not use this file except in compliance with
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki * the License. You may obtain a copy of the License at
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd *
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * http://www.apache.org/licenses/LICENSE-2.0
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd *
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Unless required by applicable law or agreed to in writing, software
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * distributed under the License is distributed on an "AS IS" BASIS,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * See the License for the specific language governing permissions and
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * limitations under the License.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/**
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @file httpd.h
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @brief HTTP Daemon routines
4b5981e276e93df97c34e4da05ca5cf8bbd937dand *
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE Apache
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd *
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * Top level group of which all other groups are a member
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @{
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd *
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_MODS Apache Modules
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Top level group for Apache Modules
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_OS Operating System Specific
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_CORE Apache Core
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @{
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup APACHE_CORE_DAEMON HTTP Daemon Routine
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @{
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef APACHE_HTTPD_H
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define APACHE_HTTPD_H
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* XXX - We need to push more stuff to other .h files, or even .c files, to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * make this file smaller
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Headers in which EVERYONE has an interest... */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "ap_config.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "ap_mmn.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "ap_release.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#include "apr.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "apr_general.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "apr_tables.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "apr_pools.h"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#include "apr_time.h"
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#include "apr_network_io.h"
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#include "apr_buckets.h"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#include "apr_poll.h"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#include "os.h"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#include "ap_regex.h"
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#if APR_HAVE_STDLIB_H
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#include <stdlib.h>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#endif
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd/* Note: apr_uri.h is also included, see below */
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifdef __cplusplus
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndextern "C" {
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifdef CORE_PRIVATE
4c36c711036219c80d5517d35be68a4769c15291slive
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* ----------------------------- config dir ------------------------------ */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Define this to be the default server home dir. Most things later in this
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * file with a relative pathname will have this added.
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef HTTPD_ROOT
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifdef OS2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set default for OS/2 file system */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTPD_ROOT "/os2httpd"
b95ae799514ad86a15610ad75808d7065e9847c9kess#elif defined(WIN32)
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set default for Windows file system */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTPD_ROOT "/apache"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#elif defined (BEOS)
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set the default for BeOS */
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#define HTTPD_ROOT "/boot/home/apache"
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#elif defined (NETWARE)
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Set the default for NetWare */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTPD_ROOT "/apache"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#else
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Set for all other OSs */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTPD_ROOT "/usr/local/apache"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif /* HTTPD_ROOT */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/*
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * --------- You shouldn't have to edit anything below this line ----------
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Any modifications to any defaults not defined above should be done in the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * respective configuration file.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Default location of documents. Can be overridden by the DocumentRoot
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * directive.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef DOCUMENT_LOCATION
97a9a944b5887e91042b019776c41d5dd74557aferikabele#ifdef OS2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* Set default for OS/2 file system */
4c36c711036219c80d5517d35be68a4769c15291slive#define DOCUMENT_LOCATION HTTPD_ROOT "/docs"
4c36c711036219c80d5517d35be68a4769c15291slive#else
4c36c711036219c80d5517d35be68a4769c15291slive/* Set default for non OS/2 file system */
4c36c711036219c80d5517d35be68a4769c15291slive#define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs"
4c36c711036219c80d5517d35be68a4769c15291slive#endif
4c36c711036219c80d5517d35be68a4769c15291slive#endif /* DOCUMENT_LOCATION */
4c36c711036219c80d5517d35be68a4769c15291slive
4c36c711036219c80d5517d35be68a4769c15291slive/** Maximum number of dynamically loaded modules */
4c36c711036219c80d5517d35be68a4769c15291slive#ifndef DYNAMIC_MODULE_LIMIT
4c36c711036219c80d5517d35be68a4769c15291slive#define DYNAMIC_MODULE_LIMIT 128
4c36c711036219c80d5517d35be68a4769c15291slive#endif
f736cd11585a35572d5f42accf026eb667848434slive
4c36c711036219c80d5517d35be68a4769c15291slive/** Default administrator's address */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define DEFAULT_ADMIN "[no address given]"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** The name of the log files */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef DEFAULT_ERRORLOG
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#if defined(OS2) || defined(WIN32)
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#define DEFAULT_ERRORLOG "logs/error.log"
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#else
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#define DEFAULT_ERRORLOG "logs/error_log"
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowen#endif
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif /* DEFAULT_ERRORLOG */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Define this to be what your per-directory security files are called */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifndef DEFAULT_ACCESS_FNAME
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifdef OS2
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* Set default for OS/2 file system */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define DEFAULT_ACCESS_FNAME "htaccess"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#else
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define DEFAULT_ACCESS_FNAME ".htaccess"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif /* DEFAULT_ACCESS_FNAME */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The name of the server config file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef SERVER_CONFIG_FILE
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define SERVER_CONFIG_FILE "conf/httpd.conf"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** The default path for CGI scripts if none is currently set */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#ifndef DEFAULT_PATH
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The path to the suExec wrapper, can be overridden in Configuration */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef SUEXEC_BIN
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define SUEXEC_BIN HTTPD_ROOT "/bin/suexec"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The timeout for waiting for messages */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#ifndef DEFAULT_TIMEOUT
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_TIMEOUT 300
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The timeout for waiting for keepalive timeout until next request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#ifndef DEFAULT_KEEPALIVE_TIMEOUT
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_KEEPALIVE_TIMEOUT 5
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#endif
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The number of requests to entertain per connection */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef DEFAULT_KEEPALIVE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_KEEPALIVE 100
97a9a944b5887e91042b019776c41d5dd74557aferikabele#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/*
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Limits on the size of various request items. These limits primarily
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * exist to prevent simple denial-of-service attacks on a server based
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * on misuse of the protocol. The recommended values will depend on the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * nature of the server resources -- CGI scripts and database backends
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * might require large values, but most servers could get by with much
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * smaller limits than we use below. The request message body size can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * be limited by the per-dir config directive LimitRequestBody.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * These two limits can be lowered (but not raised) by the server config
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * directives LimitRequestLine and LimitRequestFieldsize, respectively.
97a9a944b5887e91042b019776c41d5dd74557aferikabele *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the server config directive LimitRequestFields.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on bytes in Request-Line (Method+URI+HTTP-version) */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#ifndef DEFAULT_LIMIT_REQUEST_LINE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_LIMIT_REQUEST_LINE 8190
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on bytes in any one header field */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** default limit on number of request header fields */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DEFAULT_LIMIT_REQUEST_FIELDS 100
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The default default character set name to add if AddDefaultCharset is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * enabled. Overridden with AddDefaultCharsetName.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#endif /* CORE_PRIVATE */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** default HTTP Server protocol */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define AP_SERVER_PROTOCOL "HTTP/1.1"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* ------------------ stuff that modules are allowed to look at ----------- */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Define this to be what your HTML directory content files are called */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifndef AP_DEFAULT_INDEX
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define AP_DEFAULT_INDEX "index.html"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/**
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Define this to be what type you'd like returned for files with unknown
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * suffixes.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @warning MUST be all lower case.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#ifndef DEFAULT_CONTENT_TYPE
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define DEFAULT_CONTENT_TYPE "text/plain"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#endif
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * NO_CONTENT_TYPE is an alternative DefaultType value that suppresses
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * setting any default type when there's no information (e.g. a proxy).
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#ifndef NO_CONTENT_TYPE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define NO_CONTENT_TYPE "none"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The name of the MIME types file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_TYPES_CONFIG_FILE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define AP_TYPES_CONFIG_FILE "conf/mime.types"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/*
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Define the HTML doctype strings centrally.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** HTML 2.0 Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 2.0//EN\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 3.2 Doctype */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "DTD HTML 3.2 Final//EN\">\n"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** HTML 4.0 Strict Doctype */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 4.0//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 4.0 Transitional Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem "DTD HTML 4.0 Transitional//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** HTML 4.0 Frameset Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD HTML 4.0 Frameset//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** XHTML 1.0 Strict Doctype */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "DTD XHTML 1.0 Strict//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "\"http://www.w3.org/TR/xhtml1/DTD/" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "xhtml1-strict.dtd\">\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** XHTML 1.0 Transitional Doctype */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \
c6a2d6fa44f8698851dec5051ee3782c2913605fnd "DTD XHTML 1.0 Transitional//EN\"\n" \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "\"http://www.w3.org/TR/xhtml1/DTD/" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "xhtml1-transitional.dtd\">\n"
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** XHTML 1.0 Frameset Doctype */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "DTD XHTML 1.0 Frameset//EN\"\n" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "\"http://www.w3.org/TR/xhtml1/DTD/" \
97a9a944b5887e91042b019776c41d5dd74557aferikabele "xhtml1-frameset.dtd\">"
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_VERSION(major,minor) (1000*(major)+(minor))
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Major part of HTTP protocol */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_VERSION_MAJOR(number) ((number)/1000)
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Minor part of HTTP protocol */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_VERSION_MINOR(number) ((number)%1000)
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* -------------- Port number for server running standalone --------------- */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** default HTTP Port */
74a6de79356cd15d2e47065087785e36dd65aa41nd#define DEFAULT_HTTP_PORT 80
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** default HTTPS Port */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define DEFAULT_HTTPS_PORT 443
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Check whether @a port is the default port for the request @a r.
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param port The port number
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param r The request
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @see #ap_default_port
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Get the default port for a request (which depends on the scheme).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param r The request
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
53d2fd50ff45e7c568f0588c742a5ef9edf8e275rbowen#define ap_default_port(r) ap_run_default_port(r)
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Get the scheme for a request.
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param r The request
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_http_scheme(r) ap_run_http_scheme(r)
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The default string length */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define MAX_STRING_LEN HUGE_STRING_LEN
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The length of a Huge string */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HUGE_STRING_LEN 8192
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The size of the server's internal read-write buffers */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define AP_IOBUFSIZE 8192
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** The max number of regex captures that can be expanded by ap_pregsub */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define AP_MAX_REG_MATCH 10
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * APR_HAS_LARGE_FILES introduces the problem of spliting sendfile into
97a9a944b5887e91042b019776c41d5dd74557aferikabele * mutiple buckets, no greater than MAX(apr_size_t), and more granular
97a9a944b5887e91042b019776c41d5dd74557aferikabele * than that in case the brigade code/filters attempt to read it directly.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * ### 16mb is an invention, no idea if it is reasonable.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define AP_MAX_SENDFILE 16777216 /* 2^24 */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Special Apache error codes. These are basically used
97a9a944b5887e91042b019776c41d5dd74557aferikabele * in http_main.c so we can keep track of various errors.
97a9a944b5887e91042b019776c41d5dd74557aferikabele *
fb82af0f0cd7b58eef19c54b086131b7e1e1e749madhum */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** a normal exit */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define APEXIT_OK 0x0
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** A fatal error arising during the server's init sequence */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define APEXIT_INIT 0x2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** The child died during its init sequence */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define APEXIT_CHILDINIT 0x3
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The child exited due to a resource shortage.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The parent should limit the rate of forking until
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the situation is resolved.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define APEXIT_CHILDSICK 0x7
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A fatal error, resulting in the whole server aborting.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * If a child exits with this error, the parent process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * considers this a server-wide fatal error and aborts.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define APEXIT_CHILDFATAL 0xf
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_DECLARE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Stuff marked #AP_DECLARE is part of the API, and intended for use
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * by modules. Its purpose is to allow us to add attributes that
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * particular platforms or compilers require to every exported function.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_DECLARE(type) type
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_DECLARE_NONSTD
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Stuff marked #AP_DECLARE_NONSTD is part of the API, and intended for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * use by modules. The difference between #AP_DECLARE and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * #AP_DECLARE_NONSTD is that the latter is required for any functions
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * which use varargs or are used via indirect function call. This
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * is to accomodate the two calling conventions in windows dlls.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_DECLARE_NONSTD(type) type
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_DECLARE_DATA
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_DECLARE_DATA
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_MODULE_DECLARE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_MODULE_DECLARE(type) type
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_MODULE_DECLARE_NONSTD
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_MODULE_DECLARE_NONSTD(type) type
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_MODULE_DECLARE_DATA
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_MODULE_DECLARE_DATA
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd#endif
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd/**
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * @internal
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * modules should not use functions marked AP_CORE_DECLARE
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd#ifndef AP_CORE_DECLARE
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd# define AP_CORE_DECLARE AP_DECLARE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @internal
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * modules should not use functions marked AP_CORE_DECLARE_NONSTD
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#ifndef AP_CORE_DECLARE_NONSTD
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# define AP_CORE_DECLARE_NONSTD AP_DECLARE_NONSTD
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#endif
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief The numeric version information is broken out into fields within this
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * structure.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef struct {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int major; /**< major number */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int minor; /**< minor number */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int patch; /**< patch number */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem const char *add_string; /**< additional string like "-dev" */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem} ap_version_t;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return httpd's version information in a numeric form.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem *
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param version Pointer to a version structure for returning the version
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * information.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
eaaa852423e42d6d86bcada80ed781a205fc3e5fndAP_DECLARE(void) ap_get_server_revision(ap_version_t *version);
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd/**
eaaa852423e42d6d86bcada80ed781a205fc3e5fnd * Get the server banner in a form suitable for sending over the
fb82af0f0cd7b58eef19c54b086131b7e1e1e749madhum * network, with the level of information controlled by the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * ServerTokens directive.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The server banner
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(const char *) ap_get_server_banner(void);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * Get the server description in a form suitable for local displays,
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * status reports, or logging. This includes the detailed server
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * version and information about some modules. It is not affected
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * by the ServerTokens directive.
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * @return The server description
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl */
9335f6d807d76d60e54af4ededdebebddb3e3d13noodlAP_DECLARE(const char *) ap_get_server_description(void);
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Add a component to the server description and banner strings
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param pconf The pool to allocate the component from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param component The string to add
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Get the date a time that the server was built
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return The server build time string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(const char *) ap_get_server_built(void);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DECLINED -1 /**< Module declines to handle */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DONE -2 /**< Module has served the response completely
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * - it's safe to die() with no more output
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define OK 0 /**< Module has handled this stage. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @defgroup HTTP_Status HTTP Status Codes
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @{
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The size of the static array in http_protocol.c for storing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * all of the potential response status-lines (a sparse table).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A future version should dynamically generate the apr_table_t at startup.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define RESPONSE_CODES 57
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_CONTINUE 100
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_SWITCHING_PROTOCOLS 101
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_PROCESSING 102
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_OK 200
630c456b6461158be6cc5c5483735e27b13b4ad5nd#define HTTP_CREATED 201
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_ACCEPTED 202
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_NON_AUTHORITATIVE 203
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_NO_CONTENT 204
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_RESET_CONTENT 205
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_PARTIAL_CONTENT 206
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_MULTI_STATUS 207
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_MULTIPLE_CHOICES 300
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_MOVED_PERMANENTLY 301
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_MOVED_TEMPORARILY 302
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_SEE_OTHER 303
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_NOT_MODIFIED 304
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_USE_PROXY 305
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_TEMPORARY_REDIRECT 307
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_BAD_REQUEST 400
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_UNAUTHORIZED 401
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_PAYMENT_REQUIRED 402
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_FORBIDDEN 403
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_NOT_FOUND 404
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_METHOD_NOT_ALLOWED 405
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_NOT_ACCEPTABLE 406
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_REQUEST_TIME_OUT 408
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_CONFLICT 409
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_GONE 410
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_LENGTH_REQUIRED 411
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_PRECONDITION_FAILED 412
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_REQUEST_ENTITY_TOO_LARGE 413
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_REQUEST_URI_TOO_LARGE 414
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_UNSUPPORTED_MEDIA_TYPE 415
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_RANGE_NOT_SATISFIABLE 416
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_EXPECTATION_FAILED 417
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_UNPROCESSABLE_ENTITY 422
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_LOCKED 423
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_FAILED_DEPENDENCY 424
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_UPGRADE_REQUIRED 426
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_INTERNAL_SERVER_ERROR 500
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_NOT_IMPLEMENTED 501
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_BAD_GATEWAY 502
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_SERVICE_UNAVAILABLE 503
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_GATEWAY_TIME_OUT 504
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define HTTP_VERSION_NOT_SUPPORTED 505
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_VARIANT_ALSO_VARIES 506
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define HTTP_INSUFFICIENT_STORAGE 507
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define HTTP_NOT_EXTENDED 510
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code informational */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code OK ?*/
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code a redirect */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a error (client or server) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a client error */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** is the status code a server error */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** is the status code a (potentially) valid response code? */
4e3cdb85620921a8a120fe22edbccae708f4f34end#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
4e3cdb85620921a8a120fe22edbccae708f4f34end
4e3cdb85620921a8a120fe22edbccae708f4f34end/** should the status code drop the connection */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define ap_status_drops_connection(x) \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem (((x) == HTTP_BAD_REQUEST) || \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem ((x) == HTTP_REQUEST_TIME_OUT) || \
4e3cdb85620921a8a120fe22edbccae708f4f34end ((x) == HTTP_LENGTH_REQUIRED) || \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
97a9a944b5887e91042b019776c41d5dd74557aferikabele ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive ((x) == HTTP_SERVICE_UNAVAILABLE) || \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive ((x) == HTTP_NOT_IMPLEMENTED))
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** @} */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @defgroup Methods List of Methods recognized by the server
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @ingroup APACHE_CORE_DAEMON
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @{
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Methods recognized (but not necessarily handled) by the server.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem *
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * These constants are used in bit shifting masks of size int, so it is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * unsafe to have more methods than bits in an int. HEAD == M_GET.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * This list must be tracked by the list in http_protocol.c in routine
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * ap_method_name_of().
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define M_GET 0 /** RFC 2616: HTTP */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_PUT 1 /* : */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_POST 2
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_DELETE 3
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_CONNECT 4
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_OPTIONS 5
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_TRACE 6 /** RFC 2616: HTTP */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_PATCH 7 /** no rfc(!) ### remove this one? */
22d5d84393d960a2027f472036f3fee15d7dbce9nd#define M_PROPFIND 8 /** RFC 2518: WebDAV */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_PROPPATCH 9 /* : */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_MKCOL 10
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_COPY 11
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define M_MOVE 12
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_LOCK 13
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_UNLOCK 14 /** RFC 2518: WebDAV */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_VERSION_CONTROL 15 /** RFC 3253: WebDAV Versioning */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_CHECKOUT 16 /* : */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_UNCHECKOUT 17
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_CHECKIN 18
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_UPDATE 19
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_LABEL 20
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_REPORT 21
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define M_MKWORKSPACE 22
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define M_MKACTIVITY 23
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_BASELINE_CONTROL 24
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define M_MERGE 25
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define M_INVALID 26 /** RFC 3253: WebDAV Versioning */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * METHODS needs to be equal to the number of bits
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * we are using for limit masks.
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define METHODS 64
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The method mask bit to shift for anding with a bitmask.
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl */
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl#define AP_METHOD_BIT ((apr_int64_t)1)
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl/** @} */
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl/** @see ap_method_list_t */
9335f6d807d76d60e54af4ededdebebddb3e3d13noodltypedef struct ap_method_list_t ap_method_list_t;
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl/**
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl * @struct ap_method_list_t
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Structure for handling HTTP methods.
22d5d84393d960a2027f472036f3fee15d7dbce9nd *
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Methods known to the server are accessed via a bitmask shortcut;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * extension methods are handled by an array.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslivestruct ap_method_list_t {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The bitmask used for known methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_int64_t method_mask;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the array used for extension methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_array_header_t *method_list;
97a9a944b5887e91042b019776c41d5dd74557aferikabele};
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @defgroup module_magic Module Magic mime types
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @{
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** Magic for mod_cgi[d] */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define CGI_MAGIC_TYPE "application/x-httpd-cgi"
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Magic for mod_include */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** Magic for mod_include */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** Magic for mod_dir */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DIR_MAGIC_TYPE "httpd/unix-directory"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** @} */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Just in case your linefeed isn't the one the other end is expecting. */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#if !APR_CHARSET_EBCDIC
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/** linefeed */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define LF 10
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** carrige return */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define CR 13
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** carrige return /Line Feed Combo */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define CRLF "\015\012"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#else /* APR_CHARSET_EBCDIC */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * in the buff package (bread/bputs/bwrite). Everywhere else, we use
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * "native EBCDIC" CR and NL characters. These are therefore
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * defined as
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * '\r' and '\n'.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define CR '\r'
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define LF '\n'
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define CRLF "\r\n"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#endif /* APR_CHARSET_EBCDIC */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @defgroup values_request_rec_body Possible values for request_rec.read_body
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @{
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Possible values for request_rec.read_body (set by handling module):
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Send 413 error if message has any body */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define REQUEST_NO_BODY 0
4c36c711036219c80d5517d35be68a4769c15291slive/** Send 411 error if body without Content-Length */
4c36c711036219c80d5517d35be68a4769c15291slive#define REQUEST_CHUNKED_ERROR 1
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** If chunked, remove the chunks for me. */
4c36c711036219c80d5517d35be68a4769c15291slive#define REQUEST_CHUNKED_DECHUNK 2
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** @} // values_request_rec_body */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/**
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @defgroup values_request_rec_used_path_info Possible values for request_rec.used_path_info
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @ingroup APACHE_CORE_DAEMON
627c978514c54179736d152923478be7c8707f9bnd * @{
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Possible values for request_rec.used_path_info:
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Accept the path_info from the request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#define AP_REQ_ACCEPT_PATH_INFO 0
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** Return a 404 error if path_info was given */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define AP_REQ_REJECT_PATH_INFO 1
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** Module may chose to use the given path_info */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define AP_REQ_DEFAULT_PATH_INFO 2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/** @} // values_request_rec_used_path_info */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/*
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Things which may vary per file-lookup WITHIN a request ---
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * e.g., state of MIME config. Basically, the name of an object, info
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * about the object, and any other info we may ahve which may need to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * change as we go poking around looking for it (e.g., overridden by
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * .htaccess files).
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd *
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Note how the default state of almost all these things is properly
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * zero, so that allocating it with pcalloc does the right thing without
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * a whole lot of hairy initialization... so long as we are willing to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * make the (fairly) portable assumption that the bit pattern of a NULL
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * pointer is, in fact, zero.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief This represents the result of calling htaccess; these are cached for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * each request.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
97a9a944b5887e91042b019776c41d5dd74557aferikabelestruct htaccess_result {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the directory to which this applies */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *dir;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the overrides allowed for the .htaccess file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int override;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the override options allowed for the .htaccess file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int override_opts;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** the configuration directives */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_conf_vector_t *htaccess;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** the next one, or NULL if no more; N.B. never change this */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const struct htaccess_result *next;
97a9a944b5887e91042b019776c41d5dd74557aferikabele};
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* The following four types define a hierarchy of activities, so that
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * given a request_rec r you can write r->connection->server->process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * to get to the process_rec. While this reduces substantially the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * number of arguments that various hooks require beware that in
97a9a944b5887e91042b019776c41d5dd74557aferikabele * threaded versions of the server you must consider multiplexing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * issues. */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele/** A structure that represents one process */
97a9a944b5887e91042b019776c41d5dd74557aferikabeletypedef struct process_rec process_rec;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents a virtual server */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtypedef struct server_rec server_rec;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents one connection */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtypedef struct conn_rec conn_rec;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents the current request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtypedef struct request_rec request_rec;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/** A structure that represents the status of the current connection */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtypedef struct conn_state_t conn_state_t;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* ### would be nice to not include this from httpd.h ... */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/* This comes after we have defined the request_rec type */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#include "apr_uri.h"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief A structure that represents one process
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslivestruct process_rec {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Global pool. Cleared upon normal exit */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_pool_t *pool;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Configuration pool. Cleared upon restart */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_pool_t *pconf;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Number of command line arguments passed to the program */
97a9a944b5887e91042b019776c41d5dd74557aferikabele int argc;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The command line arguments */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char * const *argv;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The program name used to execute the program */
97a9a944b5887e91042b019776c41d5dd74557aferikabele const char *short_name;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive};
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @brief A structure that represents the current request
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndstruct request_rec {
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The pool associated with the request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd apr_pool_t *pool;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The connection to the client */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd conn_rec *connection;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** The virtual host for this request */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd server_rec *server;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the redirected request if this is an external redirect */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd request_rec *next;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the previous request if this is an internal redirect */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd request_rec *prev;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pointer to the main request if this is a sub-request
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * (see http_request.h) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive request_rec *main;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Info about the request itself... we begin with stuff that only
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * protocol.c should ever touch...
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** First line of request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *the_request;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** HTTP/0.9, "simple" request (e.g. GET /foo\n w/no headers) */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int assbackwards;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A proxy request (calculated during post_read_request/translate_name)
97a9a944b5887e91042b019776c41d5dd74557aferikabele * possible values PROXYREQ_NONE, PROXYREQ_PROXY, PROXYREQ_REVERSE,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * PROXYREQ_RESPONSE
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int proxyreq;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** HEAD request, as opposed to GET */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int header_only;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Protocol string, as given to us, or HTTP/0.9 */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *protocol;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Protocol version number of protocol; 1.1 = 1001 */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int proto_num;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Host, as set by full URI or Host: */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *hostname;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Time when the request started */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_time_t request_time;
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Status line, if set by script */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen const char *status_line;
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Status line */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen int status;
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen * look, but don't touch.
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** Request method (eg. GET, HEAD, POST, etc.) */
8ac3ff7008df949c096f9cd8f769c7893594f61fnd const char *method;
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen /** M_GET, M_POST, etc. */
0ccb6ee166750359937ae35d59c0beb54f8fd228rbowen int method_number;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * 'allowed' is a bitvector of the allowed methods.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A handler must ensure that the request method is one that
97a9a944b5887e91042b019776c41d5dd74557aferikabele * it is capable of handling. Generally modules should DECLINE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * any request methods they do not handle. Prior to aborting the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * handler like this the handler should set r->allowed to the list
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * of methods that it is willing to handle. This bitvector is used
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * to construct the "Allow:" header required for OPTIONS requests,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * and HTTP_METHOD_NOT_ALLOWED and HTTP_NOT_IMPLEMENTED status codes.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Since the default_handler deals with OPTIONS, all modules can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * usually decline to deal with OPTIONS. TRACE is always allowed,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * modules don't need to set it explicitly.
97a9a944b5887e91042b019776c41d5dd74557aferikabele *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Since the default_handler will always handle a GET, a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * module which does *not* implement GET should probably return
97a9a944b5887e91042b019776c41d5dd74557aferikabele * HTTP_METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * handler can't be installed by mod_actions.
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_int64_t allowed;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Array of extension methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_array_header_t *allowed_xmethods;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** List of allowed methods */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive ap_method_list_t *allowed_methods;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** byte count in stream is for body */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_off_t sent_bodyct;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** body byte count, for easy access */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_off_t bytes_sent;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Last modified time of the requested resource */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_time_t mtime;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* HTTP/1.1 connection-level features */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** sending chunked transfer-coding */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int chunked;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The Range: header */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *range;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The "real" content length */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_off_t clength;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Remaining bytes left to read from the request body */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_off_t remaining;
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** Number of bytes that have been read from the request body */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen apr_off_t read_length;
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** Method for reading the request body
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * (eg. REQUEST_CHUNKED_ERROR, REQUEST_NO_BODY,
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * REQUEST_CHUNKED_DECHUNK, etc...) */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen int read_body;
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen /** reading chunked transfer-coding */
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen int read_chunked;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** is client waiting for a 100 response? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive unsigned expecting_100;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* MIME header environments, in and out. Also, an array containing
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * environment variables to be passed to subprocesses, so people can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * write modules to add to that environment.
97a9a944b5887e91042b019776c41d5dd74557aferikabele *
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The difference between headers_out and err_headers_out is that the
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * latter are printed even on error, and persist across internal redirects
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * (so the headers printed for ErrorDocument handlers will have them).
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen *
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * The 'notes' apr_table_t is for notes from one module to another, with no
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen * other set purpose in mind...
36088d24dae5b2cc8124264fc6a9ba349ba81adcrbowen */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** MIME header environment from the request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_table_t *headers_in;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** MIME header environment for the response */
97a9a944b5887e91042b019776c41d5dd74557aferikabele apr_table_t *headers_out;
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** MIME header environment for the response, printed even on errors and
1578daeec017d3bb20cecdcdc3b0261c999730d5slive * persist across internal redirects */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive apr_table_t *err_headers_out;
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** Array of environment variables to be used for sub processes */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive apr_table_t *subprocess_env;
1578daeec017d3bb20cecdcdc3b0261c999730d5slive /** Notes from one module to another */
1578daeec017d3bb20cecdcdc3b0261c999730d5slive apr_table_t *notes;
1578daeec017d3bb20cecdcdc3b0261c999730d5slive
ab6f5669a4cb16dbff7d791d434ba1b9c9b50928nd /* content_type, handler, content_encoding, and all content_languages
9f7f8f89dfb9115b0b9493049a6ca1ecd8508242rbowen * MUST be lowercased strings. They may be pointers to static strings;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * they should not be modified in place.
9f7f8f89dfb9115b0b9493049a6ca1ecd8508242rbowen */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The content-type for the current request */
97a9a944b5887e91042b019776c41d5dd74557aferikabele const char *content_type; /* Break these out --- we dispatch on 'em */
9f7f8f89dfb9115b0b9493049a6ca1ecd8508242rbowen /** The handler string that we use to call a handler function */
97a9a944b5887e91042b019776c41d5dd74557aferikabele const char *handler; /* What we *really* dispatch on */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** How to encode the data */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *content_encoding;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Array of strings representing the content languages */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_array_header_t *content_languages;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** variant list validator (if negotiated) */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem char *vlist_validator;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** If an authentication check was made, this gets set to the user name. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *user;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** If an authentication check was made, this gets set to the auth type. */
97a9a944b5887e91042b019776c41d5dd74557aferikabele char *ap_auth_type;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** This response can not be cached */
97a9a944b5887e91042b019776c41d5dd74557aferikabele int no_cache;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** There is no local copy of this response */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int no_local_copy;
97a9a944b5887e91042b019776c41d5dd74557aferikabele
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /* What object is being requested (either directly, or via include
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * or content-negotiation mapping).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
97a9a944b5887e91042b019776c41d5dd74557aferikabele
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** The URI without any parsing performed */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *unparsed_uri;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The path portion of the URI */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *uri;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The filename on disk corresponding to this response */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *filename;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /* XXX: What does this mean? Please define "canonicalize" -aaron */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The true filename, we canonicalize r->filename if these don't match */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *canonical_filename;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The PATH_INFO extracted from this request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive char *path_info;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** The QUERY_ARGS extracted from this request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem char *args;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** finfo.protection (st_mode) set to zero if no such file */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_finfo_t finfo;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A struct containing the components of URI */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_uri_t parsed_uri;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Flag for the handler to accept or reject path_info on
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the current request. All modules should respect the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * AP_REQ_ACCEPT_PATH_INFO and AP_REQ_REJECT_PATH_INFO
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * values, while AP_REQ_DEFAULT_PATH_INFO indicates they
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * may follow existing conventions. This is set to the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * user's preference upon HOOK_VERY_FIRST of the fixups.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int used_path_info;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Various other config info which may change with .htaccess files
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * These are config vectors, with one void* pointer for each module
97a9a944b5887e91042b019776c41d5dd74557aferikabele * (the thing pointed to being the module's business).
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Options set in config files, etc. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_conf_vector_t *per_dir_config;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Notes on *this* request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_conf_vector_t *request_config;
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * A linked list of the .htaccess configuration directives
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * accessed by this request.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * N.B. always add to the head of the list, _never_ to the end.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * that way, a sub request's list can (temporarily) point to a parent's list
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem const struct htaccess_result *htaccess;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of output filters to be used for this request */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem struct ap_filter_t *output_filters;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of input filters to be used for this request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_filter_t *input_filters;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** A list of protocol level output filters to be used for this
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_filter_t *proto_output_filters;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** A list of protocol level input filters to be used for this
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * request */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd struct ap_filter_t *proto_input_filters;
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd /** A flag to determine if the eos bucket has been sent yet */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd int eos_sent;
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd /** The optional kept body of the request. */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd apr_bucket_brigade *kept_body;
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd/* Things placed at the end of the record to avoid breaking binary
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * compatibility. It would be nice to remember to reorder the entire
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * record to improve 64bit alignment the next time we need to break
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * binary compatibility for some other reason.
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd */
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd};
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd/**
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * @defgroup ProxyReq Proxy request types
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd *
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * Possible values of request_rec->proxyreq. A request could be normal,
4c881d2fffa365e2e0c5e25eb1cf77f4f9406e44chrisd * proxied or reverse proxied. Normally proxied and reverse proxied are
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * grouped together as just "proxied", but sometimes it's necessary to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * tell the difference between the two, such as for authentication.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @{
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define PROXYREQ_NONE 0 /**< No proxy */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define PROXYREQ_PROXY 1 /**< Standard proxy */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#define PROXYREQ_REVERSE 2 /**< Reverse proxy */
97a9a944b5887e91042b019776c41d5dd74557aferikabele#define PROXYREQ_RESPONSE 3 /**< Origin response */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* @} */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @brief Enumeration of connection keepalive options
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef enum {
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd AP_CONN_UNKNOWN,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd AP_CONN_CLOSE,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd AP_CONN_KEEPALIVE
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd} ap_conn_keepalive_e;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/**
0203b896e484dfb877111aceffb812401d0f216and * @brief Structure to store things which are per connection
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndstruct conn_rec {
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Pool associated with this connection */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd apr_pool_t *pool;
844def494f17cb1ab0983427d5c3939e1a03ff8cnd /** Physical vhost this conn came in on */
0203b896e484dfb877111aceffb812401d0f216and server_rec *base_server;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** used by http_vhost.c */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive void *vhost_lookup_data;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Information about the connection itself */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** local address */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem apr_sockaddr_t *local_addr;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** remote address */
0203b896e484dfb877111aceffb812401d0f216and apr_sockaddr_t *remote_addr;
0203b896e484dfb877111aceffb812401d0f216and
0203b896e484dfb877111aceffb812401d0f216and /** Client's IP address */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem char *remote_ip;
0203b896e484dfb877111aceffb812401d0f216and /** Client's DNS name, if known. NULL if DNS hasn't been checked,
0203b896e484dfb877111aceffb812401d0f216and * "" if it has and no address was found. N.B. Only access this though
0203b896e484dfb877111aceffb812401d0f216and * get_remote_host() */
0203b896e484dfb877111aceffb812401d0f216and char *remote_host;
0203b896e484dfb877111aceffb812401d0f216and /** Only ever set if doing rfc1413 lookups. N.B. Only access this through
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * get_remote_logname() */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd char *remote_logname;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Are we still talking? */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd unsigned aborted:1;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** Are we going to keep the connection alive for another request?
96147932f199be4ad038778e702c13a2f79051c0slive * @see ap_conn_keepalive_e */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd ap_conn_keepalive_e keepalive;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd /** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * 1 yes/success */
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd signed int double_reverse:2;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** How many times have we used it? */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int keepalives;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** server IP address */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem char *local_ip;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** used for ap_get_server_name when UseCanonicalName is set to DNS
630c456b6461158be6cc5c5483735e27b13b4ad5nd * (ignores setting of HostnameLookups) */
630c456b6461158be6cc5c5483735e27b13b4ad5nd char *local_host;
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl /** ID of this connection; unique at any point in time */
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl long id;
8c8c2e71c84babf0e8c4b35819c7c5b3be014cfenoodl /** Config vector containing pointers to connections per-server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * config structures. */
96147932f199be4ad038778e702c13a2f79051c0slive struct ap_conf_vector_t *conn_config;
96147932f199be4ad038778e702c13a2f79051c0slive /** Notes on *this* connection: send note from one module to
96147932f199be4ad038778e702c13a2f79051c0slive * another. must remain valid for all requests on this conn */
96147932f199be4ad038778e702c13a2f79051c0slive apr_table_t *notes;
96147932f199be4ad038778e702c13a2f79051c0slive /** A list of input filters to be used for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive struct ap_filter_t *input_filters;
96147932f199be4ad038778e702c13a2f79051c0slive /** A list of output filters to be used for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive struct ap_filter_t *output_filters;
96147932f199be4ad038778e702c13a2f79051c0slive /** handle to scoreboard information for this connection */
96147932f199be4ad038778e702c13a2f79051c0slive void *sbh;
96147932f199be4ad038778e702c13a2f79051c0slive /** The bucket allocator to use for all bucket/brigade creations */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem struct apr_bucket_alloc_t *bucket_alloc;
d1348237b33bc1755b9f1165eea52317465a7671nd /** The current state of this connection */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive conn_state_t *cs;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** Is there data pending in the input filters? */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int data_in_input_filters;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Is there data pending in the output filters? */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int data_in_output_filters;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Are there any filters that clogg/buffer the input stream, breaking
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * the event mpm.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int clogging_input_filters;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem};
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Enumeration of connection states
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemtypedef enum {
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem CONN_STATE_CHECK_REQUEST_LINE_READABLE,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem CONN_STATE_READ_REQUEST_LINE,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive CONN_STATE_HANDLER,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive CONN_STATE_WRITE_COMPLETION,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem CONN_STATE_LINGER
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem} conn_state_e;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief A structure to contain connection state information
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
97a9a944b5887e91042b019776c41d5dd74557aferikabelestruct conn_state_t {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** APR_RING of expiration timeouts */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem APR_RING_ENTRY(conn_state_t) timeout_list;
96147932f199be4ad038778e702c13a2f79051c0slive /** the expiration time of the next keepalive timeout */
630c456b6461158be6cc5c5483735e27b13b4ad5nd apr_time_t expiration_time;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Current state of the connection */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem conn_state_e state;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** connection record this struct refers to */
97a9a944b5887e91042b019776c41d5dd74557aferikabele conn_rec *c;
edc8d9e0cce625a77afd1ff87a8f955694a973e2rbowen /** memory pool to allocate from */
97a9a944b5887e91042b019776c41d5dd74557aferikabele apr_pool_t *p;
edc8d9e0cce625a77afd1ff87a8f955694a973e2rbowen /** bucket allocator */
edc8d9e0cce625a77afd1ff87a8f955694a973e2rbowen apr_bucket_alloc_t *bucket_alloc;
97a9a944b5887e91042b019776c41d5dd74557aferikabele /** poll file decriptor information */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_pollfd_t pfd;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem};
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/* Per-vhost config... */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The address 255.255.255.255, when used as a virtualhost address,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * will become the "default" server when the ip doesn't match other vhosts.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem#define DEFAULT_VHOST_ADDR 0xfffffffful
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @struct server_addr_rec
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @brief A structure to be used for Per-vhost config
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef struct server_addr_rec server_addr_rec;
96147932f199be4ad038778e702c13a2f79051c0slivestruct server_addr_rec {
96147932f199be4ad038778e702c13a2f79051c0slive /** The next server in the list */
96147932f199be4ad038778e702c13a2f79051c0slive server_addr_rec *next;
96147932f199be4ad038778e702c13a2f79051c0slive /** The bound address, for this server */
96147932f199be4ad038778e702c13a2f79051c0slive apr_sockaddr_t *host_addr;
96147932f199be4ad038778e702c13a2f79051c0slive /** The bound port, for this server */
96147932f199be4ad038778e702c13a2f79051c0slive apr_port_t host_port;
96147932f199be4ad038778e702c13a2f79051c0slive /** The name given in "<VirtualHost>" */
96147932f199be4ad038778e702c13a2f79051c0slive char *virthost;
96147932f199be4ad038778e702c13a2f79051c0slive};
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive/**
96147932f199be4ad038778e702c13a2f79051c0slive * @brief A structure to store information for each virtual server
96147932f199be4ad038778e702c13a2f79051c0slive */
96147932f199be4ad038778e702c13a2f79051c0slivestruct server_rec {
96147932f199be4ad038778e702c13a2f79051c0slive /** The process this server is running in */
96147932f199be4ad038778e702c13a2f79051c0slive process_rec *process;
96147932f199be4ad038778e702c13a2f79051c0slive /** The next server in the list */
96147932f199be4ad038778e702c13a2f79051c0slive server_rec *next;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /** The name of the server */
96147932f199be4ad038778e702c13a2f79051c0slive const char *defn_name;
96147932f199be4ad038778e702c13a2f79051c0slive /** The line of the config file that the server was defined on */
96147932f199be4ad038778e702c13a2f79051c0slive unsigned defn_line_number;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /* Contact information */
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /** The admin's contact information */
96147932f199be4ad038778e702c13a2f79051c0slive char *server_admin;
96147932f199be4ad038778e702c13a2f79051c0slive /** The server hostname */
96147932f199be4ad038778e702c13a2f79051c0slive char *server_hostname;
96147932f199be4ad038778e702c13a2f79051c0slive /** for redirects, etc. */
96147932f199be4ad038778e702c13a2f79051c0slive apr_port_t port;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /* Log files --- note that transfer log is now in the modules... */
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /** The name of the error log */
96147932f199be4ad038778e702c13a2f79051c0slive char *error_fname;
96147932f199be4ad038778e702c13a2f79051c0slive /** A file descriptor that references the error log */
96147932f199be4ad038778e702c13a2f79051c0slive apr_file_t *error_log;
96147932f199be4ad038778e702c13a2f79051c0slive /** The log level for this server */
96147932f199be4ad038778e702c13a2f79051c0slive int loglevel;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /* Module-specific configuration for server, and defaults... */
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /** true if this is the virtual server */
96147932f199be4ad038778e702c13a2f79051c0slive int is_virtual;
96147932f199be4ad038778e702c13a2f79051c0slive /** Config vector containing pointers to modules' per-server config
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * structures. */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_conf_vector_t *module_config;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** MIME type info, etc., before we start checking per-directory info */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive struct ap_conf_vector_t *lookup_defaults;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /* Transaction handling */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** I haven't got a clue */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive server_addr_rec *addrs;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Timeout, as an apr interval, before we give up */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_interval_time_t timeout;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** The apr interval we will wait for another request */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_interval_time_t keep_alive_timeout;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Maximum requests per connection */
96147932f199be4ad038778e702c13a2f79051c0slive int keep_alive_max;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Use persistent connections? */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int keep_alive;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Pathname for ServerPath */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *path;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Length of path */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int pathlen;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Normal names for ServerAlias servers */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive apr_array_header_t *names;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** Wildcarded names for ServerAlias servers */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem apr_array_header_t *wild_names;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on size of the HTTP request line */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int limit_req_line;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on size of any request header field */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem int limit_req_fieldsize;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem /** limit on number of request header fields */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive int limit_req_fields;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slive /** The server request scheme for redirect responses */
96147932f199be4ad038778e702c13a2f79051c0slive const char *server_scheme;
96147932f199be4ad038778e702c13a2f79051c0slive};
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slivetypedef struct core_output_filter_ctx {
96147932f199be4ad038778e702c13a2f79051c0slive apr_bucket_brigade *buffered_bb;
96147932f199be4ad038778e702c13a2f79051c0slive apr_size_t bytes_in;
96147932f199be4ad038778e702c13a2f79051c0slive apr_size_t bytes_written;
96147932f199be4ad038778e702c13a2f79051c0slive} core_output_filter_ctx_t;
70373b9ee042e7b3be82eee14b17f510fffdacc9slive
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetypedef struct core_filter_ctx {
96147932f199be4ad038778e702c13a2f79051c0slive apr_bucket_brigade *b;
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem apr_bucket_brigade *tmpbb;
06ba4a61654b3763ad65f52283832ebf058fdf1cslive} core_ctx_t;
96147932f199be4ad038778e702c13a2f79051c0slive
96147932f199be4ad038778e702c13a2f79051c0slivetypedef struct core_net_rec {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /** Connection to the client */
8a571abb6573d916da05fc8b9f04fd944ad45803slive apr_socket_t *client_socket;
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl /** connection record */
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl conn_rec *c;
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl core_output_filter_ctx_t *out_ctx;
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl core_ctx_t *in_ctx;
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl} core_net_rec;
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl/**
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * Examine a field value (such as a media-/content-type) string and return
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @param p Pool to allocate memory from
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @param intype The field to examine
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl * @return A copy of the field minus any parameters
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Convert a time from an integer into a string in a specified format
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param t The time to convert
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param fmt The format to use for the conversion
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param gmt Convert the time for GMT?
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The string that represents the specified time
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/* String handling. The *_nc variants allow you to use non-const char **s as
8a7ed8b6e3f5b266680dba1c890d1b9c6c0426efnoodl arguments (unfortunately C won't automatically convert a char ** to a const
8a571abb6573d916da05fc8b9f04fd944ad45803slive char **) */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get the characters until the first occurance of a specified character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param line The string to get the characters from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param stop The character to stop at
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the characters up to the first stop character
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get the characters until the first occurance of a specified character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The string to get the characters from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param stop The character to stop at
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return A copy of the characters up to the first stop character
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @note This is the same as ap_getword(), except it doesn't use const char **.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Get the first word from a given string. A word is defined as all characters
8a571abb6573d916da05fc8b9f04fd944ad45803slive * up to the first whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The string to traverse
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The first word in the line
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Get the first word from a given string. A word is defined as all characters
8a571abb6573d916da05fc8b9f04fd944ad45803slive * up to the first whitespace.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The string to traverse
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The first word in the line
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note The same as ap_getword_white(), except it doesn't use const char**
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Get all characters from the first occurance of @a stop to the first "\0"
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate memory from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The line to traverse
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param stop The character to start at
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return A copy of all caracters after the first occurance of the specified
8a571abb6573d916da05fc8b9f04fd944ad45803slive * character
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
8a571abb6573d916da05fc8b9f04fd944ad45803slive char stop);
8ed0917f332087770872e032b248b2e1e689df3bslive
8ed0917f332087770872e032b248b2e1e689df3bslive/**
8ed0917f332087770872e032b248b2e1e689df3bslive * Get all characters from the first occurance of @a stop to the first "\0"
8ed0917f332087770872e032b248b2e1e689df3bslive * @param p The pool to allocate memory from
8ed0917f332087770872e032b248b2e1e689df3bslive * @param line The line to traverse
8ed0917f332087770872e032b248b2e1e689df3bslive * @param stop The character to start at
8ed0917f332087770872e032b248b2e1e689df3bslive * @return A copy of all caracters after the first occurance of the specified
8ed0917f332087770872e032b248b2e1e689df3bslive * character
8ed0917f332087770872e032b248b2e1e689df3bslive * @note The same as ap_getword_nulls(), except it doesn't use const char **.
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Get the second word in the string paying attention to quoting
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param line The line to traverse
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Get the second word in the string paying attention to quoting
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param line The line to traverse
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return A copy of the string
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @note The same as ap_getword_conf(), except it doesn't use const char **.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Check a string for any ${ENV} environment variable construct and replace
8a571abb6573d916da05fc8b9f04fd944ad45803slive * each them by the value of that environment variable, if it exists. If the
8a571abb6573d916da05fc8b9f04fd944ad45803slive * environment value does not exist, leave the ${ENV} construct alone; it
8a571abb6573d916da05fc8b9f04fd944ad45803slive * means something else.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param word The string to check
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return The string with the replaced environment variables
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen */
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Size an HTTP header field list item, as separated by a comma.
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param field The field to size
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param len The length of the field
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return The return value is a pointer to the beginning of the non-empty
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * list item within the original string (or NULL if there is none) and the
8a571abb6573d916da05fc8b9f04fd944ad45803slive * address of field is shifted to the next non-comma, non-whitespace
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * character. len is the length of the item excluding any beginning whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Retrieve an HTTP header field list item, as separated by a comma,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * while stripping insignificant whitespace and lowercasing anything not in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * a quoted string or comment.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param field The field to retrieve
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The return value is a new string containing the converted list
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * item (or NULL if none) and the address pointed to by field is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * shifted to the next non-comma, non-whitespace.
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Find an item in canonical form (lowercase, no extra spaces) within
8a571abb6573d916da05fc8b9f04fd944ad45803slive * an HTTP field value list.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The field value list to search
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param tok The token to search for
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return 1 if found, 0 if not found.
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Retrieve a token, spacing over it and adjusting the pointer to
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * the first non-white byte afterwards. Note that these tokens
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * are delimited by semis and commas and can also be delimited
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * by whitespace at the caller's option.
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param p The pool to allocate from
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param accept_line The line to retrieve the token from (adjusted afterwards)
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param accept_white Is it delimited by whitespace
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @return the token
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
9b82bd7c7f2083318e7856831dede324534308bcrbowen
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Find http tokens, see the definition of token from RFC2068
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param line The line to find the token
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param tok The token to find
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return 1 if the token is found, 0 otherwise
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * find http tokens from the end of the line
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param line The line to find the token
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param tok The token to find
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 1 if the token is found, 0 otherwise
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Check for an Absolute URI syntax
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param u The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if URI, 0 otherwise
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(int) ap_is_url(const char *u);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Unescape a URL
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param url The url to unescape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 0 on success, non-zero otherwise
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_unescape_url(char *url);
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Unescape a URL, but leaving %2f (slashes) escaped
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param url The url to unescape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return 0 on success, non-zero otherwise
b5407b0669a6a7175c84859e727d133399e4fa51slive */
b5407b0669a6a7175c84859e727d133399e4fa51sliveAP_DECLARE(int) ap_unescape_url_keep2f(char *url);
b5407b0669a6a7175c84859e727d133399e4fa51slive
b5407b0669a6a7175c84859e727d133399e4fa51slive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Convert all double slashes to single slashes
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param name The string to convert
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(void) ap_no2slash(char *name);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Remove all ./ and xx/../ substrings from a file name. Also remove
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * any leading ../ or /../ substrings.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param name the file name to parse
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(void) ap_getparents(char *name);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Escape a path segment, as defined in RFC 1808
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * @param p The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param s The path to convert
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The converted URL
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * convert an OS path to a URL in an OS dependant way.
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param path The path to convert
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param partial if set, assume that the path will be appended to something
8a571abb6573d916da05fc8b9f04fd944ad45803slive * with a '/' in it (and thus does not prefix "./")
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The converted URL
8a571abb6573d916da05fc8b9f04fd944ad45803slive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/** @see ap_os_escape_path */
8a571abb6573d916da05fc8b9f04fd944ad45803slive#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive/**
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * Escape an html string
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * @param p The pool to allocate from
758cbf6f938a9e5b39422509d1e39b7078c1a1dcslive * @param s The html to escape
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @return The escaped string
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
8a571abb6573d916da05fc8b9f04fd944ad45803slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * Escape a string for logging
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to escape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The escaped string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
8a571abb6573d916da05fc8b9f04fd944ad45803sliveAP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
8a571abb6573d916da05fc8b9f04fd944ad45803slive/**
8a571abb6573d916da05fc8b9f04fd944ad45803slive * Escape a string for logging into the error log (without a pool)
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param dest The buffer to write to
20189240503ef2c8f5dc6e2248b57faab4b23b5and * @param source The string to escape
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param buflen The buffer size for the escaped string (including "\0")
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return The len of the escaped string (always < maxlen)
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen */
173a6aaf8f8d2c818ab71d3781400e521051a565rbowenAP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen apr_size_t buflen);
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen/**
173a6aaf8f8d2c818ab71d3781400e521051a565rbowen * Construct a full hostname
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param p The pool to allocate from
8a571abb6573d916da05fc8b9f04fd944ad45803slive * @param hostname The hostname of the server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param port The port the server is running on
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param r The current request
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The server's hostname
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe */
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwroweAP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe apr_port_t port, const request_rec *r);
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe/**
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Escape a shell command
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param p The pool to allocate from
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param s The command to escape
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The escaped shell command
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe/**
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Count the number of directories in a path
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param path The path to count
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return The number of directories
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe */
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwroweAP_DECLARE(int) ap_count_dirs(const char *path);
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe/**
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * Copy at most @a n leading directories of @a s into @a d. @a d
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * should be at least as large as @a s plus 1 extra byte
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe *
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param d The location to copy to
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param s The location to copy from
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @param n The number of directories to copy
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @return value is the ever useful pointer to the trailing "\0" of d
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * @note on platforms with drive letters, n = 0 returns the "/" root,
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * whereas n = 1 returns the "d:/" root. On all other platforms, n = 0
beae3b927f4a40ba2f0b84d90cacfa1f0d528babwrowe * returns the empty string. */
97a9a944b5887e91042b019776c41d5dd74557aferikabeleAP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return the parent directory name (including trailing /) of the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @a s
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param s The file to get the parent of
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A copy of the file's parent directory
97a9a944b5887e91042b019776c41d5dd74557aferikabele */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Given a directory and filename, create a single path from them. This
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * function is smart enough to ensure that there is a sinlge '/' between the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * directory and file names
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param a The pool to allocate from
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param dir The directory name
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param f The filename
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @return A copy of the full path
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note Never consider using this function if you are dealing with filesystem
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * names that need to remain canonical, unless you are merging an apr_dir_read
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * path and returned filename. Otherwise, the result is not canonical.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Test if the given path has an an absolute path.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param dir The directory name
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @note The converse is not necessarily true, some OS's (Win32/OS2/Netware) have
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * multiple forms of absolute paths. This only reports if the path is absolute
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * in a canonical sense.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Does the provided string contain wildcard characters? This is useful
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * for determining if the string should be passed to strcmp_match or to strcmp.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * The only wildcard characters recognized are '?' and '*'
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if the string has wildcards, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_is_matchexp(const char *str);
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Determine if a string matches a patterm containing the wildcards '?' or '*'
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @param str The string to check
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem * @param expected The pattern to match against
97a9a944b5887e91042b019776c41d5dd74557aferikabele * @return 1 if the two strings match, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
97a9a944b5887e91042b019776c41d5dd74557aferikabeleAP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
97a9a944b5887e91042b019776c41d5dd74557aferikabele * Determine if a string matches a patterm containing the wildcards '?' or '*',
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * ignoring case
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param str The string to check
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param expected The pattern to match against
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return 1 if the two strings match, 0 otherwise
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Find the first occurrence of the substring s2 in s1, regardless of case
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param s1 The string to search
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param s2 The substring to search for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A pointer to the beginning of the substring
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @remark See apr_strmatch() for a faster alternative
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemAP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Return a pointer to the location inside of bigstring immediately after prefix
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param bigstring The input string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param prefix The prefix to strip away
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return A pointer relative to bigstring after prefix
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive const char *prefix);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/**
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * Decode a base64 encoded string into memory allocated from a pool
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param p The pool to allocate from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @param bufcoded The encoded string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * @return The decoded string
06ba4a61654b3763ad65f52283832ebf058fdf1cslive */
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
97a9a944b5887e91042b019776c41d5dd74557aferikabele
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd/**
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * Encode a string into memory allocated from a pool in base 64 format
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd * @param p The pool to allocate from
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * @param string The plaintext string
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @return The encoded string
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd */
50337bc37d6a337217f0295bc57aaac558517c11jimAP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string);
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
611049e38bfbaeb173d2d7fab2e44a48753436a1nd/**
* Compile a regular expression to be used later
* @param p The pool to allocate from
* @param pattern the regular expression to compile
* @param cflags The bitwise or of one or more of the following:
* @li REG_EXTENDED - Use POSIX extended Regular Expressions
* @li REG_ICASE - Ignore case
* @li REG_NOSUB - Support for substring addressing of matches
* not required
* @li REG_NEWLINE - Match-any-character operators don't match new-line
* @return The compiled regular expression
*/
AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
int cflags);
/**
* Free the memory associated with a compiled regular expression
* @param p The pool the regex was allocated from
* @param reg The regular expression to free
*/
AP_DECLARE(void) ap_pregfree(apr_pool_t *p, ap_regex_t *reg);
/**
* After performing a successful regex match, you may use this function to
* perform a series of string substitutions based on subexpressions that were
* matched during the call to ap_regexec
* @param p The pool to allocate from
* @param input An arbitrary string containing $1 through $9. These are
* replaced with the corresponding matched sub-expressions
* @param source The string that was originally matched to the regex
* @param nmatch the nmatch returned from ap_pregex
* @param pmatch the pmatch array returned from ap_pregex
*/
AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
size_t nmatch, ap_regmatch_t pmatch[]);
/**
* We want to downcase the type/subtype for comparison purposes
* but nothing else because ;parameter=foo values are case sensitive.
* @param s The content-type to convert to lowercase
*/
AP_DECLARE(void) ap_content_type_tolower(char *s);
/**
* convert a string to all lowercase
* @param s The string to convert to lowercase
*/
AP_DECLARE(void) ap_str_tolower(char *s);
/**
* Search a string from left to right for the first occurrence of a
* specific character
* @param str The string to search
* @param c The character to search for
* @return The index of the first occurrence of c in str
*/
AP_DECLARE(int) ap_ind(const char *str, char c); /* Sigh... */
/**
* Search a string from right to left for the first occurrence of a
* specific character
* @param str The string to search
* @param c The character to search for
* @return The index of the first occurrence of c in str
*/
AP_DECLARE(int) ap_rind(const char *str, char c);
/**
* Given a string, replace any bare " with \" .
* @param p The pool to allocate memory from
* @param instring The string to search for "
* @return A copy of the string with escaped quotes
*/
AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
/**
* Given a string, append the PID deliminated by delim.
* Usually used to create a pid-appended filepath name
* (eg: /a/b/foo -> /a/b/foo.6726). A function, and not
* a macro, to avoid unistd.h dependency
* @param p The pool to allocate memory from
* @param string The string to append the PID to
* @param delim The string to use to deliminate the string from the PID
* @return A copy of the string with the PID appended
*/
AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
const char *delim);
/* Misc system hackery */
/**
* Given the name of an object in the file system determine if it is a directory
* @param p The pool to allocate from
* @param name The name of the object to check
* @return 1 if it is a directory, 0 otherwise
*/
AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
/**
* Given the name of an object in the file system determine if it is a directory - this version is symlink aware
* @param p The pool to allocate from
* @param name The name of the object to check
* @return 1 if it is a directory, 0 otherwise
*/
AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
#ifdef _OSD_POSIX
extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
#endif /* _OSD_POSIX */
/**
* Determine the local host name for the current machine
* @param p The pool to allocate from
* @return A copy of the local host name
*/
char *ap_get_local_host(apr_pool_t *p);
/**
* Log an assertion to the error log
* @param szExp The assertion that failed
* @param szFile The file the assertion is in
* @param nLine The line the assertion is defined on
*/
AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
__attribute__((noreturn));
/**
* @internal Internal Assert function
*/
#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
/**
* Redefine assert() to something more useful for an Apache...
*
* Use ap_assert() if the condition should always be checked.
* Use AP_DEBUG_ASSERT() if the condition should only be checked when AP_DEBUG
* is defined.
*/
#ifdef AP_DEBUG
#define AP_DEBUG_ASSERT(exp) ap_assert(exp)
#else
#define AP_DEBUG_ASSERT(exp) ((void)0)
#endif
/**
* @defgroup stopsignal Flags which indicate places where the sever should stop for debugging.
* @{
* A set of flags which indicate places where the server should raise(SIGSTOP).
* This is useful for debugging, because you can then attach to that process
* with gdb and continue. This is important in cases where one_process
* debugging isn't possible.
*/
/** stop on a Detach */
#define SIGSTOP_DETACH 1
/** stop making a child process */
#define SIGSTOP_MAKE_CHILD 2
/** stop spawning a child process */
#define SIGSTOP_SPAWN_CHILD 4
/** stop spawning a child process with a piped log */
#define SIGSTOP_PIPED_LOG_SPAWN 8
/** stop spawning a CGI child process */
#define SIGSTOP_CGI_CHILD 16
/** Macro to get GDB started */
#ifdef DEBUG_SIGSTOP
extern int raise_sigstop_flags;
#define RAISE_SIGSTOP(x) do { \
if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
} while (0)
#else
#define RAISE_SIGSTOP(x)
#endif
/** @} */
/**
* Get HTML describing the address and (optionally) admin of the server.
* @param prefix Text which is prepended to the return value
* @param r The request_rec
* @return HTML describing the server, allocated in @a r's pool.
*/
AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r);
/** strtoul does not exist on sunos4. */
#ifdef strtoul
#undef strtoul
#endif
#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
/* The C library has functions that allow const to be silently dropped ...
these macros detect the drop in maintainer mode, but use the native
methods for normal builds
Note that on some platforms (e.g., AIX with gcc, Solaris with gcc), string.h needs
to be included before the macros are defined or compilation will fail.
*/
#include <string.h>
AP_DECLARE(char *) ap_strchr(char *s, int c);
AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
AP_DECLARE(char *) ap_strrchr(char *s, int c);
AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
AP_DECLARE(char *) ap_strstr(char *s, const char *c);
AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);
#ifdef AP_DEBUG
#undef strchr
# define strchr(s, c) ap_strchr(s,c)
#undef strrchr
# define strrchr(s, c) ap_strrchr(s,c)
#undef strstr
# define strstr(s, c) ap_strstr(s,c)
#else
/** use this instead of strchr */
# define ap_strchr(s, c) strchr(s, c)
/** use this instead of strchr */
# define ap_strchr_c(s, c) strchr(s, c)
/** use this instead of strrchr */
# define ap_strrchr(s, c) strrchr(s, c)
/** use this instead of strrchr */
# define ap_strrchr_c(s, c) strrchr(s, c)
/** use this instead of strrstr*/
# define ap_strstr(s, c) strstr(s, c)
/** use this instead of strrstr*/
# define ap_strstr_c(s, c) strstr(s, c)
#endif
#define AP_NORESTART APR_OS_START_USEERR + 1
#ifdef __cplusplus
}
#endif
#endif /* !APACHE_HTTPD_H */
/** @} //APACHE Daemon */
/** @} //APACHE Core */
/** @} //APACHE super group */