request.c revision 0540a0b469147b52e858587270dba31c2aaa9e09
842ae4bd224140319ae7feec1872b93dfd491143fielding/* ====================================================================
842ae4bd224140319ae7feec1872b93dfd491143fielding * The Apache Software License, Version 1.1
842ae4bd224140319ae7feec1872b93dfd491143fielding * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
842ae4bd224140319ae7feec1872b93dfd491143fielding * reserved.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * Redistribution and use in source and binary forms, with or without
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * modification, are permitted provided that the following conditions
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * 1. Redistributions of source code must retain the above copyright
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * notice, this list of conditions and the following disclaimer.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * 2. Redistributions in binary form must reproduce the above copyright
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * notice, this list of conditions and the following disclaimer in
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * the documentation and/or other materials provided with the
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * distribution.
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * 3. The end-user documentation included with the redistribution,
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * if any, must include the following acknowledgment:
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * "This product includes software developed by the
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * Apache Software Foundation (http://www.apache.org/)."
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * Alternately, this acknowledgment may appear in the software itself,
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * if and wherever such third-party acknowledgments normally appear.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * 4. The names "Apache" and "Apache Software Foundation" must
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * not be used to endorse or promote products derived from this
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * software without prior written permission. For written
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * permission, please contact apache@apache.org.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * 5. Products derived from this software may not be called "Apache",
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * nor may "Apache" appear in their name, without prior written
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * permission of the Apache Software Foundation.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
8f54dc133e1a89300196d85dd6f910962007cf68brianp * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * SUCH DAMAGE.
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * ====================================================================
e302f38fd646764ce1a1e1c578d794aef514a9e5sf * This software consists of voluntary contributions made by many
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * individuals on behalf of the Apache Software Foundation. For more
baf4649272f3dabd48b095a23b3180cc0105dce6rjung * information on the Apache Software Foundation, please see
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * Portions of this software are based upon public domain software
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * originally written at the National Center for Supercomputing Applications,
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * University of Illinois, Urbana-Champaign.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * http_request.c: functions to get and process requests
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * Rob McCool 3/21/93
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * Thoroughly revamped by rst for Apache. NB this file reads
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantz * best from the bottom up.
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantzAP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
8c83461e53ca7d204e1d634f0c78199d60320d7bjerenkrantzAP_IMPLEMENT_HOOK_RUN_ALL(int,create_request,(request_rec *r),(r),OK,DECLINED)
return HTTP_INTERNAL_SERVER_ERROR;
return status;
int access_status;
if (access_status) {
return access_status;
return access_status;
return access_status;
return access_status;
return access_status;
return access_status;
switch (ap_satisfies(r)) {
case SATISFY_ALL:
case SATISFY_NOSPEC:
if (ap_some_auth_required(r)) {
case SATISFY_ANY:
if (!ap_some_auth_required(r)) {
* in mod-proxy for r->proxyreq && r->parsed_uri.scheme
* && !strcmp(r->parsed_uri.scheme, "http")
return access_status;
return OK;
* Directive order in the httpd.conf file and its Includes significantly
typedef struct walk_walked_t {
typedef struct walk_cache_t {
} walk_cache_t;
return cache;
return OK;
r->filename);
return HTTP_FORBIDDEN;
int res;
return HTTP_FORBIDDEN;
return HTTP_FORBIDDEN;
return OK;
!= APR_SUCCESS)
return HTTP_FORBIDDEN;
return HTTP_FORBIDDEN;
return HTTP_FORBIDDEN;
return OK;
#ifndef REPLACE_PATH_INFO_METHOD
#if defined(OS2)
return OK;
char *lastp;
int res;
return OK;
if (lastp == d)
if (lastp)
return OK;
return HTTP_FORBIDDEN;
return HTTP_FORBIDDEN;
return HTTP_FORBIDDEN;
char *cp;
int rv;
return OK;
#ifdef HAVE_DRIVE_LETTERS
bStripSlash = 0;
#ifdef HAVE_UNC_PATHS
int iCount=0;
p = path;
iCount++;
bStripSlash = 0;
if (bStripSlash)
return OK;
--cp;
return HTTP_FORBIDDEN;
return OK;
&core_module);
char *test_filename;
char *test_dirname;
int res;
unsigned i, num_dirs;
int j, test_filename_len;
return OK;
return res;
#ifdef NO_LONGER_PARANOID
return HTTP_FORBIDDEN;
r->filename);
return HTTP_FORBIDDEN;
return res;
--num_dirs;
++num_dirs;
#if defined(HAVE_UNC_PATHS)
#if defined(NETWARE)
int overrides_here;
&core_module);
return res;
* from access.conf.
for (; j < num_sec; ++j) {
char *entry_dir;
if (this_conf) {
&core_module);
if (res)
return res;
if (htaccess_conf) {
for (; j < num_sec; ++j) {
if (!entry_core->r) {
* APR_DIR test. But if you accessed /symlink/index.html, for example,
return res;
&core_module);
int sec_idx;
int res;
char *seg_name;
char *delim;
return OK;
== APR_SUCCESS) {
char *buf;
return HTTP_INTERNAL_SERVER_ERROR;
sec_idx = 0;
int overrides_here;
&core_module);
const char *entry_dir;
&core_module);
if (overrides_here) {
if (res)
return res;
if (htaccess_conf) {
if (delim) {
++seg_name;
if (!*seg_name)
return res;
r->filename);
++seg;
if (!entry_core->r) {
x * APR_DIR test. But if you accessed /symlink/index.html, for example,
if (now_merged)
r->per_dir_config,
return OK;
&core_module);
const char *entry_uri;
if (!num_sec) {
return OK;
/* Location and LocationMatch differ on their behaviour w.r.t. multiple
* Otherwise (as is the case with most dir_merged/file_merged requests)
return OK;
if (entry_core->r
if (matches) {
++last_walk;
--matches;
matches = 0;
if (now_merged)
if (matches)
if (now_merged)
r->per_dir_config,
return OK;
&core_module);
const char *test_file;
return OK;
if (!num_sec) {
return OK;
return OK;
int sec_idx;
if (entry_core->r
if (matches) {
++last_walk;
--matches;
matches = 0;
if (now_merged)
if (matches)
if (now_merged)
r->per_dir_config,
return OK;
return rr;
if (next_filter) {
if (APR_BUCKET_IS_EOS(e)) {
return APR_SUCCESS;
if (!reqs_arr)
const char *new_file,
const request_rec *r,
int res;
char *udir;
return rnew;
const request_rec *r,
const request_rec *r,
int res;
char *fdir;
char *udir;
#ifdef REPLACE_PATH_INFO_METHOD
return rnew;
const request_rec *r,
int res;
char *fdir;
return rnew;
#ifdef REPLACE_PATH_INFO_METHOD
return rnew;
int retval;
return retval;