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