http_request.h revision 44da058d96ca5577a8b9fe7d6b89d79fe9a0a849
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/* ====================================================================
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * The Apache Software License, Version 1.1
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * reserved.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Redistribution and use in source and binary forms, with or without
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * modification, are permitted provided that the following conditions
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * are met:
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 1. Redistributions of source code must retain the above copyright
2e545ce2450a9953665f701bb05350f0d3f26275nd * notice, this list of conditions and the following disclaimer.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen *
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 2. Redistributions in binary form must reproduce the above copyright
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * notice, this list of conditions and the following disclaimer in
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * the documentation and/or other materials provided with the
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen * distribution.
3f08db06526d6901aa08c110b5bc7dde6bc39905nd *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * 3. The end-user documentation included with the redistribution,
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * if any, must include the following acknowledgment:
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * "This product includes software developed by the
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * Apache Software Foundation (http://www.apache.org/)."
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Alternately, this acknowledgment may appear in the software itself,
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung * if and wherever such third-party acknowledgments normally appear.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * 4. The names "Apache" and "Apache Software Foundation" must
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * not be used to endorse or promote products derived from this
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * software without prior written permission. For written
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * permission, please contact apache@apache.org.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick *
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * 5. Products derived from this software may not be called "Apache",
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * nor may "Apache" appear in their name, without prior written
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * permission of the Apache Software Foundation.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick *
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * SUCH DAMAGE.
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * ====================================================================
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * This software consists of voluntary contributions made by many
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * individuals on behalf of the Apache Software Foundation. For more
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * information on the Apache Software Foundation, please see
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh * <http://www.apache.org/>.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier *
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Portions of this software are based upon public domain software
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * originally written at the National Center for Supercomputing Applications,
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * University of Illinois, Urbana-Champaign.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
60a4b2c422dcbb08a554fb193105c08da592718bpoirier#ifndef APACHE_HTTP_REQUEST_H
60a4b2c422dcbb08a554fb193105c08da592718bpoirier#define APACHE_HTTP_REQUEST_H
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier#include "apr_hooks.h"
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf#include "util_filter.h"
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick#ifdef __cplusplus
60a4b2c422dcbb08a554fb193105c08da592718bpoirierextern "C" {
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick#endif
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @file http_request.h
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @brief Apache Request library
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/* http_request.c is the code which handles the main line of request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * processing, once a request has been read in (finding the right per-
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * directory configuration, building it if necessary, and calling all
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * the module dispatch functions in the right order).
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf *
a04dcd330b05345681a4057702b2d43b2042e21dtrawick * The pieces here which are public to the modules, allow them to learn
a04dcd330b05345681a4057702b2d43b2042e21dtrawick * how the server would handle some other file or URI, or perhaps even
a04dcd330b05345681a4057702b2d43b2042e21dtrawick * direct the server to serve that other file instead of the one the
a04dcd330b05345681a4057702b2d43b2042e21dtrawick * client requested directly.
f8b7daeb0e3f0ac4544fcc665de10c6b69a1ce0dsf *
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * There are two ways to do that. The first is the sub_request mechanism,
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * which handles looking up files and URIs as adjuncts to some other
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * request (e.g., directory entries for multiviews and directory listings);
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * the lookup functions stop short of actually running the request, but
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * (e.g., for includes), a module may call for the request to be run
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * by calling run_sub_req. The space allocated to create sub_reqs can be
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * about which was allocated in its apr_pool_t elsewhere before doing this.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Create a sub request from the given URI. This sub request can be
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * inspected to find information about the requested URI
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param new_file The URI to lookup
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param next_filter The first filter the sub_request should use. If this is
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * NULL, it defaults to the first filter for the main request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @return The new request record
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc request_rec * ap_sub_req_lookup_uri(const char *new_file, const request_rec *r)
bed3c2e56e8f3328e780200466b9d009093db468sf */
bed3c2e56e8f3328e780200466b9d009093db468sfAP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_file,
bed3c2e56e8f3328e780200466b9d009093db468sf const request_rec *r,
bed3c2e56e8f3328e780200466b9d009093db468sf ap_filter_t *next_filter);
bed3c2e56e8f3328e780200466b9d009093db468sf
bed3c2e56e8f3328e780200466b9d009093db468sf/**
bed3c2e56e8f3328e780200466b9d009093db468sf * Create a sub request for the given file. This sub request can be
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * inspected to find information about the requested file
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param new_file The URI to lookup
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param next_filter The first filter the sub_request should use. If this is
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * NULL, it defaults to the first filter for the main request
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @return The new request record
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @deffunc request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawickAP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick const request_rec *r,
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick ap_filter_t *next_filter);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Create a sub request for the given apr_dir_read result. This sub request
bcb2c4ef861e8f8260284631b6753e1088643c8asf * can be inspected to find information about the requested file
bcb2c4ef861e8f8260284631b6753e1088643c8asf * @param finfo The apr_dir_read result to lookup
bcb2c4ef861e8f8260284631b6753e1088643c8asf * @param r The current request
bcb2c4ef861e8f8260284631b6753e1088643c8asf * @param next_filter The first filter the sub_request should use. If this is
bcb2c4ef861e8f8260284631b6753e1088643c8asf * NULL, it defaults to the first filter for the main request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @return The new request record
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc request_rec * ap_sub_req_lookup_dirent(apr_finfo_t *finfo, const request_rec *r)
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @tip The apr_dir_read flags value APR_FINFO_MIN|APR_FINFO_NAME flag is the
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * minimum recommended query if the results will be passed to apr_dir_read.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * The file info passed must include the name, and must have the same relative
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * directory as the current request.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawickAP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(apr_finfo_t *finfo,
60a4b2c422dcbb08a554fb193105c08da592718bpoirier const request_rec *r,
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick ap_filter_t *next_filter);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Create a sub request for the given URI using a specific method. This
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * sub request can be inspected to find information about the requested URI
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param method The method to use in the new sub request
57b31f30545668d28e895efe7f5c0eb15d37a03figalic * @param new_file The URI to lookup
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r The current request
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen * @param next_filter The first filter the sub_request should use. If this is
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen * NULL, it defaults to the first filter for the main request
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen * @return The new request record
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @deffunc request_rec * ap_sub_req_method_uri(const char *method, const char *new_file, const request_rec *r)
0236ede61169f34359c234625a1d792b97d7db12nd */
0236ede61169f34359c234625a1d792b97d7db12ndAP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
60a4b2c422dcbb08a554fb193105c08da592718bpoirier const char *new_file,
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf const request_rec *r,
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf ap_filter_t *next_filter);
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * An output filter to strip EOS buckets from sub-requests. This always
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * has to be inserted at the end of a sub-requests filter stack.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param f The current filter
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param bb The brigade to filter
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc apr_status_t ap_sub_req_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick apr_bucket_brigade *bb);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Run the handler for the sub request
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r The sub request to run
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @return The return code for the sub request
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @deffunc int ap_run_sub_req(request_rec *r)
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawickAP_DECLARE(int) ap_run_sub_req(request_rec *r);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * Free the memory associated with a sub request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r The sub request to finish
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc void ap_destroy_sub_req(request_rec *r)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE(void) ap_destroy_sub_req(request_rec *r);
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/*
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Then there's the case that you want some other request to be served
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * as the top-level request INSTEAD of what the client requested directly.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * If so, call this from a handler, and then immediately return OK.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Redirect the current request to some other uri
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param new_uri The URI to replace the current request with
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r The current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc void ap_internal_redirect(const char *new_uri, request_rec *r)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * This function is designed for things like actions or CGI scripts, when
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * using AddHandler, and you want to preserve the content type across
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * an internal redirect.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param new_uri The URI to replace the current request with.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r The current request
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @deffunc void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawickAP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Can be used within any handler to determine if any authentication
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * is required for the current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @return 1 if authentication is required, 0 otherwise
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @deffunc int ap_some_auth_required(request_rec *r)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE(int) ap_some_auth_required(request_rec *r);
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * Determine if the current request is the main request or a sub requests
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @retrn 1 if this is a main request, 0 otherwise
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @deffunc int ap_is_initial_req(request_rec *r)
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawickAP_DECLARE(int) ap_is_initial_req(request_rec *r);
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * Function to set the r->mtime field to the specified value if it's later
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * than what's already there.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param dependency_time Time to set the mtime to
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @deffunc void ap_update_mtime(request_rec *r, apr_time_t dependency_mtime)
b6529ec5115d80b7dedcfd0935746015b2096084minfrin */
b6529ec5115d80b7dedcfd0935746015b2096084minfrinAP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Add one or more methods to the list permitted to access the resource.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Usually executed by the content handler before the response header is
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * sent, but sometimes invoked at an earlier phase if a module knows it
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * can set the list authoritatively. Note that the methods are ADDED
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * to any already permitted unless the reset flag is non-zero. The
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * list is used to generate the Allow response header field when it
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * is needed.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The pointer to the request identifying the resource.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param reset Boolean flag indicating whether this list should
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * completely replace any current settings.
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin * @param ... A NULL-terminated list of strings, each identifying a
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * method name to add.
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * @return None.
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * @deffunc void ap_allow_methods(request_rec *r, int reset, ...)
b6529ec5115d80b7dedcfd0935746015b2096084minfrin */
b6529ec5115d80b7dedcfd0935746015b2096084minfrinAP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...);
b6529ec5115d80b7dedcfd0935746015b2096084minfrin
b6529ec5115d80b7dedcfd0935746015b2096084minfrin#define MERGE_ALLOW 0
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin#define REPLACE_ALLOW 1
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin#ifdef CORE_PRIVATE
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin/* Function called by main.c to handle first-level request */
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrinvoid ap_process_request(request_rec *);
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin/**
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin * Kill the current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param type Why the request is dieing
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @deffunc void ap_die(int type, request_rec *r)
60a4b2c422dcbb08a554fb193105c08da592718bpoirier */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE(void) ap_die(int type, request_rec *r);
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf#endif
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/* Hooks */
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/* XXX: doxygen grouping doesn't appear to work, but it should. Checking with
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * doxygen (Ben).
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Gives modules a chance to create their request_config entry when the
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * request is created.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r The current request
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @ingroup hooks
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE_HOOK(int,create_request,(request_rec *r))
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This hook allow modules an opportunity to translate the URI into an
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * actual filename. If no modules do anything special, the server's default
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * rules will be followed.
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @return OK, DECLINED, or HTTP_...
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sfAP_DECLARE_HOOK(int,translate_name,(request_rec *r))
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This hook allows modules to check the authentication information sent with
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * the request.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r The current request
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * @return OK, DECLINED, or HTTP_...
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sfAP_DECLARE_HOOK(int,check_user_id,(request_rec *r))
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
60a4b2c422dcbb08a554fb193105c08da592718bpoirier/**
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * Allows modules to perform module-specific fixing of header fields. This
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * is invoked just before any content-handler
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r The current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @return OK, DECLINED, or HTTP_...
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
60a4b2c422dcbb08a554fb193105c08da592718bpoirierAP_DECLARE_HOOK(int,fixups,(request_rec *r))
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This routine is called to determine and/or set the various document type
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * information bits, like Content-type (via r->content_type), language, et
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * cetera.
b97ba9a0b0f1bdad0bd7b4c5cb32319c2976b0aftrawick * @param r the current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @return OK, DECLINED, or HTTP_...
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sfAP_DECLARE_HOOK(int,type_checker,(request_rec *r))
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This routine is called to check for any module-specific restrictions placed
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * upon the requested resource.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r the current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @return OK, DECLINED, or HTTP_...
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sfAP_DECLARE_HOOK(int,access_checker,(request_rec *r))
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This routine is called to check to see if the resource being requested
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * requires authorisation.
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r the current request
50c04f297d76a57ead2fa6b73845f7563b1fc788sf * @return OK, DECLINED, or HTTP_...
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @ingroup hooks
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf */
8cef90cad1b259d4a94f6095aa30439c60549a5drbowenAP_DECLARE_HOOK(int,auth_checker,(request_rec *r))
8cef90cad1b259d4a94f6095aa30439c60549a5drbowen
8cef90cad1b259d4a94f6095aa30439c60549a5drbowen/**
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * This hook allows modules to insert filters for the current request
5cd08ee4a8f5a665e656f70048a1268a02bc0e73sf * @param r the current request
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick * @ingroup hooks
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick */
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawickAP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawickAP_DECLARE(int) directory_walk(request_rec *r);
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawickAP_DECLARE(int) location_walk(request_rec *r);
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawickAP_DECLARE(int) file_walk(request_rec *r);
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick#ifdef __cplusplus
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick}
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick#endif
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick
33e4ab6c78a779cb3f72f7afed0fef9068f1b822trawick#endif /* !APACHE_HTTP_REQUEST_H */
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf