http_request.h revision fd0edaa8e3d4dd67d0604ccef2e96b071db96643
842ae4bd224140319ae7feec1872b93dfd491143fielding/* ====================================================================
842ae4bd224140319ae7feec1872b93dfd491143fielding * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
842ae4bd224140319ae7feec1872b93dfd491143fielding *
842ae4bd224140319ae7feec1872b93dfd491143fielding * Redistribution and use in source and binary forms, with or without
842ae4bd224140319ae7feec1872b93dfd491143fielding * modification, are permitted provided that the following conditions
842ae4bd224140319ae7feec1872b93dfd491143fielding * are met:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * 1. Redistributions of source code must retain the above copyright
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * notice, this list of conditions and the following disclaimer.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * 2. Redistributions in binary form must reproduce the above copyright
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * notice, this list of conditions and the following disclaimer in
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * the documentation and/or other materials provided with the
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distribution.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 3. All advertising materials mentioning features or use of this
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * software must display the following acknowledgment:
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * "This product includes software developed by the Apache Group
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * for use in the Apache HTTP server project (http://www.apache.org/)."
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh * 4. The names "Apache Server" and "Apache Group" must not be used to
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * endorse or promote products derived from this software without
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * prior written permission. For written permission, please contact
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * apache@apache.org.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 5. Products derived from this software may not be called "Apache"
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * nor may "Apache" appear in their names without prior written
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * permission of the Apache Group.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 6. Redistributions of any form whatsoever must retain the following
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * acknowledgment:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * "This product includes software developed by the Apache Group
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * for use in the Apache HTTP server project (http://www.apache.org/)."
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
f888346b48f5e5b5e3f0a47dedb8cefd2759a4e2gregames * OF THE POSSIBILITY OF SUCH DAMAGE.
750d12c59545dbbac70390988de94f7e901b08f2niq * ====================================================================
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * This software consists of voluntary contributions made by many
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * individuals on behalf of the Apache Group and was originally based
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * on public domain software written at the National Center for
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Supercomputing Applications, University of Illinois, Urbana-Champaign.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * For more information on the Apache Group and the Apache HTTP server
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * project, please see <http://www.apache.org/>.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz */
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz#ifndef APACHE_HTTP_REQUEST_H
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz#define APACHE_HTTP_REQUEST_H
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz#include "ap_hooks.h"
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz#ifdef __cplusplus
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantzextern "C" {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#endif
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* http_request.c is the code which handles the main line of request
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * processing, once a request has been read in (finding the right per-
a2a0abd88b19e042a3eb2a9fa1702c25ad51303dwrowe * directory configuration, building it if necessary, and calling all
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * the module dispatch functions in the right order).
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * The pieces here which are public to the modules, allow them to learn
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * how the server would handle some other file or URI, or perhaps even
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * direct the server to serve that other file instead of the one the
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * client requested directly.
4f9c22c4f27571d54197be9674e1fc0d528192aestriker *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * There are two ways to do that. The first is the sub_request mechanism,
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * which handles looking up files and URIs as adjuncts to some other
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * request (e.g., directory entries for multiviews and directory listings);
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * the lookup functions stop short of actually running the request, but
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * (e.g., for includes), a module may call for the request to be run
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * by calling run_sub_req. The space allocated to create sub_reqs can be
4f9c22c4f27571d54197be9674e1fc0d528192aestriker * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * about which was allocated in its pool elsewhere before doing this.
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe */
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(request_rec *) ap_sub_req_lookup_uri(const char *new_file,
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const request_rec *r);
2d399cd7535887fceaa9f8f116eb98ce68ddd602trawickAPI_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file,
c2cf53a40a9814eb91db2cdf820f97d943f21628coar const request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(request_rec *) ap_sub_req_method_uri(const char *method,
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const char *new_file,
731344ed8f3677d1661c261ca5fcdd2ee3dbc74ccoar const request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(int) ap_run_sub_req(request_rec *r);
731344ed8f3677d1661c261ca5fcdd2ee3dbc74ccoarAPI_EXPORT(void) ap_destroy_sub_req(request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe/*
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe * Then there's the case that you want some other request to be served
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe * as the top-level request INSTEAD of what the client requested directly.
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe * If so, call this from a handler, and then immediately return OK.
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe */
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(void) ap_internal_redirect(const char *new_uri, request_rec *);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(void) ap_internal_redirect_handler(const char *new_uri, request_rec *);
3e392a5afd51526de3cb15d57ee46d8cb160ae65gregamesAPI_EXPORT(int) ap_some_auth_required(request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(int) ap_is_initial_req(request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweAPI_EXPORT(time_t) ap_update_mtime(request_rec *r, time_t dependency_mtime);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe#ifdef CORE_PRIVATE
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar/* Function called by main.c to handle first-level request */
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarvoid ap_process_request(request_rec *);
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarAPI_EXPORT(void) ap_die(int type, request_rec *r);
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar#endif
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar /* Hooks */
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarDECLARE_HOOK(int,translate_name,(request_rec *))
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarDECLARE_HOOK(int,check_user_id,(request_rec *))
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantzDECLARE_HOOK(int,fixups,(request_rec *))
2a6e98ba4ffa30ded5d8831664c5cb2a170a56b6coarDECLARE_HOOK(int,type_checker,(request_rec *))
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarDECLARE_HOOK(int,access_checker,(request_rec *))
8419e6f8bff1a3617933f3ba760d2bdec7442f44coarDECLARE_HOOK(int,auth_checker,(request_rec *))
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar#ifdef __cplusplus
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar}
8419e6f8bff1a3617933f3ba760d2bdec7442f44coar#endif
2a6e98ba4ffa30ded5d8831664c5cb2a170a56b6coar
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz#endif /* !APACHE_HTTP_REQUEST_H */
d4abb06ac220bb280ae996b6d21bbd257db51bb1jerenkrantz