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 
162  apr_bucket_brigade *bb);
163 
164 /*
165  * Then there's the case that you want some other request to be served
166  * as the top-level request INSTEAD of what the client requested directly.
167  * If so, call this from a handler, and then immediately return OK.
168  */
169 
175 AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
176 
184 AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r);
185 
194 
205 
213 #define AP_AUTH_INTERNAL_PER_URI 0
217 #define AP_AUTH_INTERNAL_PER_CONF 1
221 #define AP_AUTH_INTERNAL_MASK 0x000F
228 AP_DECLARE(void) ap_clear_auth_internal(void);
229 
242 
256  const char *provider_group,
257  const char *provider_name,
258  const char *provider_version,
259  const void *provider,
260  int type);
261 
264 /* Optional functions coming from mod_authn_core and mod_authz_core
265  * that list all registered authn/z providers.
266  */
268  (apr_pool_t *ptemp));
270  (apr_pool_t *ptemp));
271 
278 
285 AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
286 
302 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
304 
321 AP_DECLARE(void) ap_allow_standard_methods(request_rec *r, int reset, ...);
322 
323 #define MERGE_ALLOW 0
324 #define REPLACE_ALLOW 1
325 
332 
333 /* For post-processing after a handler has finished with a request.
334  * (Commonly used after it was suspended)
335  */
337 
345 
351 AP_DECLARE(void) ap_die(int type, request_rec *r);
352 
366  unsigned int max_blank_lines);
367 
368 /* Hooks */
369 
377 
387 
402 
419 
428 
438 
452 
467 
483 
497 AP_DECLARE(void) ap_hook_check_access(ap_HOOK_access_checker_t *pf,
498  const char * const *aszPre,
499  const char * const *aszSucc,
500  int nOrder, int type);
501 
515 AP_DECLARE(void) ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf,
516  const char * const *aszPre,
517  const char * const *aszSucc,
518  int nOrder, int type);
519 
520 
534 AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
535  const char * const *aszPre,
536  const char * const *aszSucc,
537  int nOrder, int type);
538 
552 AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf,
553  const char * const *aszPre,
554  const char * const *aszSucc,
555  int nOrder, int type);
556 
563 
573 
583 
594 
599 
602 
608 #define AP_BUCKET_IS_EOR(e) (e->type == &ap_bucket_type_eor)
609 
617 
628  request_rec *r);
629 
640 
641 #ifdef __cplusplus
642 }
643 #endif
644 
645 #endif /* !APACHE_HTTP_REQUEST_H */
646 
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)
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:552
#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:1124
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:552
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)
apr_status_t ap_request_core_filter(ap_filter_t *f, apr_bucket_brigade *bb)
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:2588
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:811
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
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:515
#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:333