Apache2
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 
78  const request_rec *r,
79  ap_filter_t *next_filter);
80 
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);
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 
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
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 
273 
289 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
291 
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 
365 
376 
386 
401 
418 
427 
437 
451 
466 
482 
495 
509 AP_DECLARE(void) ap_hook_check_access(ap_HOOK_access_checker_t *pf,
510  const char * const *aszPre,
511  const char * const *aszSucc,
512  int nOrder, int type);
513 
527 AP_DECLARE(void) ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf,
528  const char * const *aszPre,
529  const char * const *aszSucc,
530  int nOrder, int type);
531 
546 AP_DECLARE(void) ap_hook_check_autht(ap_HOOK_token_checker_t *pf,
547  const char * const *aszPre,
548  const char * const *aszSucc,
549  int nOrder, int type);
550 
564 AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
565  const char * const *aszPre,
566  const char * const *aszSucc,
567  int nOrder, int type);
568 
582 AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf,
583  const char * const *aszPre,
584  const char * const *aszSucc,
585  int nOrder, int type);
586 
593 
603 
613 
624 
629 
632 
638 #define AP_BUCKET_IS_EOR(e) ((e)->type == &ap_bucket_type_eor)
639 
647 
658  request_rec *r);
659 
666 
677 
678 #ifdef __cplusplus
679 }
680 #endif
681 
682 #endif /* !APACHE_HTTP_REQUEST_H */
#define AP_FN_ATTR_SENTINEL
Definition: ap_config.h:231
#define AP_DECLARE_HOOK(ret, name, args)
Definition: ap_hooks.h:74
APR-UTIL registration of functions exported by modules.
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)
void ap_setup_auth_internal(apr_pool_t *ptemp)
void ap_clear_auth_internal(void)
request_rec * ap_bucket_eor_request(apr_bucket *b)
void ap_internal_fast_redirect(request_rec *sub_req, request_rec *r)
apr_status_t ap_sub_req_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
int ap_directory_walk(request_rec *r)
int ap_some_auth_required(request_rec *r)
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)
int ap_file_walk(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)
apr_bucket * ap_bucket_eor_create(apr_bucket_alloc_t *list, request_rec *r)
apr_bucket * ap_bucket_eor_make(apr_bucket *b, request_rec *r)
void ap_process_request(request_rec *r)
int ap_if_walk(request_rec *r)
apr_array_header_t * authz_ap_list_provider_names(apr_pool_t *ptemp)
void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
request_rec * ap_sub_req_lookup_uri(const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
int ap_run_sub_req(request_rec *r)
AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_eor
apr_array_header_t * authn_ap_list_provider_names(apr_pool_t *ptemp)
int ap_is_initial_req(request_rec *r)
int ap_process_request_internal(request_rec *r)
void ap_allow_methods(request_rec *r, int reset,...) AP_FN_ATTR_SENTINEL
void ap_process_request_after_handler(request_rec *r)
void ap_allow_standard_methods(request_rec *r, int reset,...)
request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r, ap_filter_t *next_filter)
void ap_destroy_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_die(int type, request_rec *r)
void ap_internal_redirect(const char *new_uri, request_rec *r)
void ap_process_async_request(request_rec *r)
apr_status_t ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb, unsigned int max_blank_lines)
request_rec * ap_sub_req_lookup_dirent(const apr_finfo_t *finfo, const request_rec *r, int subtype, ap_filter_t *next_filter)
void ap_hook_check_autht(ap_HOOK_token_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
request_rec * ap_sub_req_method_uri(const char *method, const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
int ap_some_authn_required(request_rec *r)
int ap_location_walk(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)
void ap_update_mtime(request_rec *r, apr_time_t dependency_mtime)
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:128
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
Definition: apr_optional.h:50
request_rec * r
Definition: mod_dav.h:518
apr_bucket_brigade * bb
Definition: mod_dav.h:555
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
const char const dav_options_provider * provider
Definition: mod_dav.h:2719
int apr_status_t
Definition: apr_errno.h:44
int apr_int32_t
Definition: apr.h:347
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_time_t
Definition: apr_time.h:45
int translate_name(request_rec *r)
int check_user_id(request_rec *r)
int force_authn(request_rec *r)
int type_checker(request_rec *r)
int create_request(request_rec *r)
int pre_translate_name(request_rec *r)
int access_checker_ex(request_rec *r)
int auth_checker(request_rec *r)
int access_checker(request_rec *r)
int post_perdir_config(request_rec *r)
void insert_filter(request_rec *r)
int fixups(request_rec *r)
int map_to_storage(request_rec *r)
int token_checker(request_rec *r)
apr_status_t dirwalk_stat(apr_finfo_t *finfo, request_rec *r, apr_int32_t wanted)
#define AP_DECLARE_DATA
Definition: macros.h:15
#define AP_DECLARE(x)
Definition: macros.h:1
#define AP_CORE_DECLARE_NONSTD(x)
Definition: macros.h:4
The representation of a filter chain.
Definition: util_filter.h:278
Definition: apr_tables.h:62
Definition: apr_buckets.h:263
Definition: apr_buckets.h:136
Definition: apr_buckets.h:229
Definition: apr_file_info.h:174
Structure to store things which are per connection.
Definition: httpd.h:1193
A structure that represents the current request.
Definition: httpd.h:856
Apache filter library.