http_request.h revision 9d129b55f5a43abf43865c6b0eb6dd19bc22aba8
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * applicable.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding *
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * Licensed under the Apache License, Version 2.0 (the "License");
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * you may not use this file except in compliance with the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * You may obtain a copy of the License at
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * http://www.apache.org/licenses/LICENSE-2.0
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Unless required by applicable law or agreed to in writing, software
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * distributed under the License is distributed on an "AS IS" BASIS,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * See the License for the specific language governing permissions and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * limitations under the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @file http_request.h
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * @brief Apache Request library
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding *
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * request.c is the code which handles the main line of request
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * processing, once a request has been read in (finding the right per-
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * directory configuration, building it if necessary, and calling all
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * the module dispatch functions in the right order).
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * The pieces here which are public to the modules, allow them to learn
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * how the server would handle some other file or URI, or perhaps even
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * direct the server to serve that other file instead of the one the
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * client requested directly.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * There are two ways to do that. The first is the sub_request mechanism,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * which handles looking up files and URIs as adjuncts to some other
64185f9824e42f21ca7b9ae6c004484215c031a7rbb * request (e.g., directory entries for multiviews and directory listings);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * the lookup functions stop short of actually running the request, but
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * (e.g., for includes), a module may call for the request to be run
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * by calling run_sub_req. The space allocated to create sub_reqs can be
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * about which was allocated in its apr_pool_t elsewhere before doing this.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#ifndef APACHE_HTTP_REQUEST_H
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#define APACHE_HTTP_REQUEST_H
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include "apr_hooks.h"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include "util_filter.h"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#ifdef __cplusplus
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingextern "C" {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#define AP_SUBREQ_NO_ARGS 0
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#define AP_SUBREQ_MERGE_ARGS 1
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding/**
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * An internal handler used by the ap_process_request, all subrequest mechanisms
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * and the redirect mechanism.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The request, subrequest or internal redirect to pre-process
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return The return code for the request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_process_request_internal(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Create a subrequest from the given URI. This subrequest can be
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * inspected to find information about the requested URI
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param new_uri The URI to lookup
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param next_filter The first filter the sub_request should use. If this is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * NULL, it defaults to the first filter for the main request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return The new request record
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_uri,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const request_rec *r,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ap_filter_t *next_filter);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Create a subrequest for the given file. This subrequest can be
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * inspected to find information about the requested file
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param new_file The file to lookup
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param next_filter The first filter the sub_request should use. If this is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * NULL, it defaults to the first filter for the main request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return The new request record
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
c7d0205ec1649076e7742d72a25ac53779768312stoddardAP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const request_rec *r,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ap_filter_t *next_filter);
c7d0205ec1649076e7742d72a25ac53779768312stoddard/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Create a subrequest for the given apr_dir_read result. This subrequest
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * can be inspected to find information about the requested file
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param finfo The apr_dir_read result to lookup
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param subtype What type of subrequest to perform, one of;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * <PRE>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * AP_SUBREQ_NO_ARGS ignore r->args and r->path_info
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * AP_SUBREQ_MERGE_ARGS merge r->args and r->path_info
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * </PRE>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param next_filter The first filter the sub_request should use. If this is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * NULL, it defaults to the first filter for the main request
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @return The new request record
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @note The apr_dir_read flags value APR_FINFO_MIN|APR_FINFO_NAME flag is the
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald * minimum recommended query if the results will be passed to apr_dir_read.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * The file info passed must include the name, and must have the same relative
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * directory as the current request.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *finfo,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const request_rec *r,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int subtype,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ap_filter_t *next_filter);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Create a subrequest for the given URI using a specific method. This
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * subrequest can be inspected to find information about the requested URI
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param method The method to use in the new subrequest
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param new_uri The URI to lookup
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param next_filter The first filter the sub_request should use. If this is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * NULL, it defaults to the first filter for the main request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return The new request record
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const char *new_uri,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const request_rec *r,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ap_filter_t *next_filter);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * An output filter to strip EOS buckets from sub-requests. This always
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * has to be inserted at the end of a sub-requests filter stack.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param f The current filter
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @param bb The brigade to filter
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @return status code
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
c7d0205ec1649076e7742d72a25ac53779768312stoddard apr_bucket_brigade *bb);
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Run the handler for the subrequest
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The subrequest to run
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return The return code for the subrequest
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_run_sub_req(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Free the memory associated with a subrequest
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The subrequest to finish
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronaldAP_DECLARE(void) ap_destroy_sub_req(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/*
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Then there's the case that you want some other request to be served
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * as the top-level request INSTEAD of what the client requested directly.
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald * If so, call this from a handler, and then immediately return OK.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Redirect the current request to some other uri
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param new_uri The URI to replace the current request with
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This function is designed for things like actions or CGI scripts, when
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * using AddHandler, and you want to preserve the content type across
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * an internal redirect.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param new_uri The URI to replace the current request with.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Redirect the current request to a sub_req, merging the pools
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param sub_req A subrequest created from this request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @note the sub_req's pool will be merged into r's pool, be very careful
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * not to destroy this subrequest, it will be destroyed with the main request!
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_internal_fast_redirect(request_rec *sub_req, request_rec *r);
c7d0205ec1649076e7742d72a25ac53779768312stoddard
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Can be used within any handler to determine if any authentication
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * is required for the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return 1 if authentication is required, 0 otherwise
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_some_auth_required(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Determine if the current request is the main request or a subrequest
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @param r The current request
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @return 1 if this is the main request, 0 otherwise
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_is_initial_req(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Function to set the r->mtime field to the specified value if it's later
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * than what's already there.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param dependency_mtime Time to set the mtime to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Add one or more methods to the list permitted to access the resource.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Usually executed by the content handler before the response header is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * sent, but sometimes invoked at an earlier phase if a module knows it
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * can set the list authoritatively. Note that the methods are ADDED
c7d0205ec1649076e7742d72a25ac53779768312stoddard * to any already permitted unless the reset flag is non-zero. The
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * list is used to generate the Allow response header field when it
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * is needed.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The pointer to the request identifying the resource.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param reset Boolean flag indicating whether this list should
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * completely replace any current settings.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param ... A NULL-terminated list of strings, each identifying a
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * method name to add.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return None.
c7d0205ec1649076e7742d72a25ac53779768312stoddard */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Add one or more methods to the list permitted to access the resource.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Usually executed by the content handler before the response header is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * sent, but sometimes invoked at an earlier phase if a module knows it
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald * can set the list authoritatively. Note that the methods are ADDED
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * to any already permitted unless the reset flag is non-zero. The
c7d0205ec1649076e7742d72a25ac53779768312stoddard * list is used to generate the Allow response header field when it
407cde44becba3694e7c3d81ac99b5d86f4b03a9rbb * is needed.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The pointer to the request identifying the resource.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param reset Boolean flag indicating whether this list should
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * completely replace any current settings.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param ... A list of method identifiers, from the "M_" series
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * defined in httpd.h, terminated with a value of -1
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * (e.g., "M_GET, M_POST, M_OPTIONS, -1")
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return None.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(void) ap_allow_standard_methods(request_rec *r, int reset, ...);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#define MERGE_ALLOW 0
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#define REPLACE_ALLOW 1
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#ifdef CORE_PRIVATE
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Function called by main.c to handle first-level request
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald * @param r The current request
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingvoid ap_process_request(request_rec *);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Kill the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param type Why the request is dieing
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronaldAP_DECLARE(void) ap_die(int type, request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
c7d0205ec1649076e7742d72a25ac53779768312stoddard/* Hooks */
c7d0205ec1649076e7742d72a25ac53779768312stoddard
c7d0205ec1649076e7742d72a25ac53779768312stoddard/**
c7d0205ec1649076e7742d72a25ac53779768312stoddard * Gives modules a chance to create their request_config entry when the
c7d0205ec1649076e7742d72a25ac53779768312stoddard * request is created.
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @param r The current request
c7d0205ec1649076e7742d72a25ac53779768312stoddard * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,create_request,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
d0a225bdac006f3361e80bfc1be7e6f9b0e81f80ronald/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook allow modules an opportunity to translate the URI into an
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * actual filename. If no modules do anything special, the server's default
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * rules will be followed.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,translate_name,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook allow modules to set the per_dir_config based on their own
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * context (such as "<Proxy>" sections) and responds to contextless requests
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * such as TRACE that need no security or filesystem mapping.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * based on the filesystem.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return DONE (or HTTP_) if this contextless request was just fulfilled
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * (such as TRACE), OK if this is not a file, and DECLINED if this is a file.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * The core map_to_storage (HOOK_RUN_REALLY_LAST) will directory_walk
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * and file_walk the r->filename.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,map_to_storage,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook is used to analyze the request headers, authenticate the user,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * and set the user information in the request record (r->user and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * r->ap_auth_type). This hook is only run when Apache determines that
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * authentication/authorization is required for this resource (as determined
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * by the 'Require' directive). It runs after the access_checker hook, and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * before the auth_checker hook.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,check_user_id,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Allows modules to perform module-specific fixing of header fields. This
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * is invoked just before any content-handler
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r The current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,fixups,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This routine is called to determine and/or set the various document type
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * information bits, like Content-type (via r->content_type), language, et
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * cetera.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,type_checker,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook is used to apply additional access control to this resource.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * It runs *before* a user is authenticated, so this hook is really to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * apply additional restrictions independent of a user. It also runs
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * independent of 'Require' directive usage.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,access_checker,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook is used to check to see if the resource being requested
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * is available for the authenticated user (r->user and r->ap_auth_type).
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * It runs after the access_checker and check_user_id hooks. Note that
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * it will *only* be called if Apache determines that access control has
c7d0205ec1649076e7742d72a25ac53779768312stoddard * been applied to this resource (through a 'Require' directive).
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @return OK, DECLINED, or HTTP_...
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
c7d0205ec1649076e7742d72a25ac53779768312stoddard */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(int,auth_checker,(request_rec *r))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/**
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This hook allows modules to insert filters for the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @param r the current request
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * @ingroup hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbb
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbbAP_DECLARE(int) ap_location_walk(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_directory_walk(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingAP_DECLARE(int) ap_file_walk(request_rec *r);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#ifdef __cplusplus
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif /* !APACHE_HTTP_REQUEST_H */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding