Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
http_request.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
26 /*
27  * request.c is the code which handles the main line of request
28  * processing, once a request has been read in (finding the right per-
29  * directory configuration, building it if necessary, and calling all
30  * the module dispatch functions in the right order).
31  *
32  * The pieces here which are public to the modules, allow them to learn
33  * how the server would handle some other file or URI, or perhaps even
34  * direct the server to serve that other file instead of the one the
35  * client requested directly.
36  *
37  * There are two ways to do that. The first is the sub_request mechanism,
38  * which handles looking up files and URIs as adjuncts to some other
39  * request (e.g., directory entries for multiviews and directory listings);
40  * the lookup functions stop short of actually running the request, but
41  * (e.g., for includes), a module may call for the request to be run
42  * by calling run_sub_req. The space allocated to create sub_reqs can be
43  * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
44  * about which was allocated in its apr_pool_t elsewhere before doing this.
45  */
46 
47 #ifndef APACHE_HTTP_REQUEST_H
48 #define APACHE_HTTP_REQUEST_H
49 
50 #include "apr_optional.h"
51 #include "util_filter.h"
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 #define AP_SUBREQ_NO_ARGS 0
58 #define AP_SUBREQ_MERGE_ARGS 1
59 
67 
77 AP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_uri,
78  const request_rec *r,
79  ap_filter_t *next_filter);
80 
90 AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
91  const request_rec *r,
92  ap_filter_t *next_filter);
112  const request_rec *r,
113  int subtype,
114  ap_filter_t *next_filter);
125 AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
126  const char *new_uri,
127  const request_rec *r,
128  ap_filter_t *next_filter);
138 
145 
151 
152 /*
153  * Then there's the case that you want some other request to be served
154  * as the top-level request INSTEAD of what the client requested directly.
155  * If so, call this from a handler, and then immediately return OK.
156  */
157 
163 AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
164 
172 AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r);
173 
182 
192 
200 #define AP_AUTH_INTERNAL_PER_URI 0
204 #define AP_AUTH_INTERNAL_PER_CONF 1
208 #define AP_AUTH_INTERNAL_MASK 0x000F
215 AP_DECLARE(void) ap_clear_auth_internal(void);
216 
229 
243  const char *provider_group,
244  const char *provider_name,
245  const char *provider_version,
246  const void *provider,
247  int type);
248 
251 /* Optional functions coming from mod_authn_core and mod_authz_core
252  * that list all registered authn/z providers.
253  */
255  (apr_pool_t *ptemp));
257  (apr_pool_t *ptemp));
258 
265 
272 AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
273 
289 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
291 
308 AP_DECLARE(void) ap_allow_standard_methods(request_rec *r, int reset, ...);
309 
310 #define MERGE_ALLOW 0
311 #define REPLACE_ALLOW 1
312 
319 
320 /* For post-processing after a handler has finished with a request.
321  * (Commonly used after it was suspended)
322  */
324 
332 
338 AP_DECLARE(void) ap_die(int type, request_rec *r);
339 
353  unsigned int max_blank_lines);
354 
355 /* Hooks */
356 
364 
376 
386 
401 
418 
427 
437 
451 
466 
482 
496 AP_DECLARE(void) ap_hook_check_access(ap_HOOK_access_checker_t *pf,
497  const char * const *aszPre,
498  const char * const *aszSucc,
499  int nOrder, int type);
500 
514 AP_DECLARE(void) ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf,
515  const char * const *aszPre,
516  const char * const *aszSucc,
517  int nOrder, int type);
518 
519 
533 AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
534  const char * const *aszPre,
535  const char * const *aszSucc,
536  int nOrder, int type);
537 
551 AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf,
552  const char * const *aszPre,
553  const char * const *aszSucc,
554  int nOrder, int type);
555 
562 
572 
582 
593 
598 
601 
607 #define AP_BUCKET_IS_EOR(e) ((e)->type == &ap_bucket_type_eor)
608 
616 
627  request_rec *r);
628 
635 
646 
647 #ifdef __cplusplus
648 }
649 #endif
650 
651 #endif /* !APACHE_HTTP_REQUEST_H */
652 
int ap_directory_walk(request_rec *r)
void ap_internal_fast_redirect(request_rec *sub_req, request_rec *r)
apr_array_header_t * authn_ap_list_provider_names(apr_pool_t *ptemp)
int ap_run_sub_req(request_rec *r)
void ap_hook_check_authn(ap_HOOK_check_user_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
void ap_process_request(request_rec *r)
int create_request(request_rec *r)
int pre_translate_name(request_rec *r)
void ap_update_mtime(request_rec *r, apr_time_t dependency_mtime)
void ap_destroy_sub_req(request_rec *r)
Definition: apr_tables.h:62
The representation of a filter chain.
Definition: util_filter.h:278
apr_status_t dirwalk_stat(apr_finfo_t *finfo, request_rec *r, apr_int32_t wanted)
#define AP_FN_ATTR_SENTINEL
Definition: ap_config.h:231
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:123
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:555
#define AP_CORE_DECLARE_NONSTD(x)
Definition: macros.h:4
int ap_is_initial_req(request_rec *r)
#define AP_DECLARE(x)
Definition: macros.h:1
int ap_if_walk(request_rec *r)
void ap_die(int type, request_rec *r)
void ap_setup_auth_internal(apr_pool_t *ptemp)
void ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
apr_bucket * ap_bucket_eor_make(apr_bucket *b, request_rec *r)
apr_status_t ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb, unsigned int max_blank_lines)
int ap_process_request_internal(request_rec *r)
Definition: apr_buckets.h:258
void ap_process_request_after_handler(request_rec *r)
request_rec * ap_sub_req_lookup_uri(const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
Structure to store things which are per connection.
Definition: httpd.h:1183
int map_to_storage(request_rec *r)
apr_array_header_t * authz_ap_list_provider_names(apr_pool_t *ptemp)
APR-UTIL registration of functions exported by modules.
int fixups(request_rec *r)
int check_user_id(request_rec *r)
int ap_some_auth_required(request_rec *r)
request_rec * ap_sub_req_lookup_dirent(const apr_finfo_t *finfo, const request_rec *r, int subtype, ap_filter_t *next_filter)
#define AP_DECLARE_HOOK(ret, name, args)
Definition: ap_hooks.h:74
apr_int64_t apr_time_t
Definition: apr_time.h:45
apr_bucket_brigade * bb
Definition: mod_dav.h:555
int access_checker(request_rec *r)
int auth_checker(request_rec *r)
apr_status_t ap_sub_req_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
int ap_some_authn_required(request_rec *r)
Definition: apr_buckets.h:224
void insert_filter(request_rec *r)
void ap_hook_check_authz(ap_HOOK_auth_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
int ap_location_walk(request_rec *r)
apr_bucket * ap_bucket_eor_create(apr_bucket_alloc_t *list, request_rec *r)
int ap_file_walk(request_rec *r)
const char const dav_options_provider * provider
Definition: mod_dav.h:2704
request_rec * ap_sub_req_method_uri(const char *method, const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
A structure that represents the current request.
Definition: httpd.h:860
Apache filter library.
apr_status_t ap_register_auth_provider(apr_pool_t *pool, const char *provider_group, const char *provider_name, const char *provider_version, const void *provider, int type)
int force_authn(request_rec *r)
#define AP_DECLARE_DATA
Definition: macros.h:15
request_rec * ap_bucket_eor_request(apr_bucket *b)
void ap_allow_standard_methods(request_rec *r, int reset,...)
int type_checker(request_rec *r)
Definition: apr_buckets.h:131
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int translate_name(request_rec *r)
void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
int apr_status_t
Definition: apr_errno.h:44
request_rec * r
Definition: mod_dav.h:518
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
Definition: apr_optional.h:50
request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r, ap_filter_t *next_filter)
int post_perdir_config(request_rec *r)
AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_eor
void ap_internal_redirect(const char *new_uri, request_rec *r)
void ap_process_async_request(request_rec *r)
int access_checker_ex(request_rec *r)
void ap_hook_check_access(ap_HOOK_access_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
Definition: apr_file_info.h:174
void ap_allow_methods(request_rec *r, int reset,...) AP_FN_ATTR_SENTINEL
int apr_int32_t
Definition: apr.h:346