Apache HTTPD
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
54extern "C" {
55#endif
56
57#define AP_SUBREQ_NO_ARGS 0
58#define AP_SUBREQ_MERGE_ARGS 1
59
67
77AP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_uri,
78 const request_rec *r,
79 ap_filter_t *next_filter);
80
90AP_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);
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
163AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
164
172AP_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
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 */
254APR_DECLARE_OPTIONAL_FN(apr_array_header_t *, authn_ap_list_provider_names,
255 (apr_pool_t *ptemp));
256APR_DECLARE_OPTIONAL_FN(apr_array_header_t *, authz_ap_list_provider_names,
257 (apr_pool_t *ptemp));
258
265
272AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
273
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
338AP_DECLARE(void) ap_die(int type, request_rec *r);
339
353 unsigned int max_blank_lines);
354
355/* Hooks */
356
364
365
375AP_DECLARE_HOOK(int,pre_translate_name,(request_rec *r))
376
385AP_DECLARE_HOOK(int,translate_name,(request_rec *r))
386
400AP_DECLARE_HOOK(int,map_to_storage,(request_rec *r))
401
416AP_DECLARE_HOOK(int,check_user_id,(request_rec *r))
417
426
435AP_DECLARE_HOOK(int,type_checker,(request_rec *r))
436
449AP_DECLARE_HOOK(int,access_checker,(request_rec *r))
450
463AP_DECLARE_HOOK(int,access_checker_ex,(request_rec *r))
464
478AP_DECLARE_HOOK(int,auth_checker,(request_rec *r))
479
494 const char * const *aszPre,
495 const char * const *aszSucc,
496 int nOrder, int type);
497
512 const char * const *aszPre,
513 const char * const *aszSucc,
514 int nOrder, int type);
515
516
531 const char * const *aszPre,
532 const char * const *aszSucc,
533 int nOrder, int type);
534
549 const char * const *aszPre,
550 const char * const *aszSucc,
551 int nOrder, int type);
552
558AP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
559
568AP_DECLARE_HOOK(int,post_perdir_config,(request_rec *r))
569
578AP_DECLARE_HOOK(int,force_authn,(request_rec *r))
579
589AP_DECLARE_HOOK(apr_status_t,dirwalk_stat,(apr_finfo_t *finfo, request_rec *r, apr_int32_t wanted))
590
595
598
604#define AP_BUCKET_IS_EOR(e) ((e)->type == &ap_bucket_type_eor)
605
613
624 request_rec *r);
625
636
637#ifdef __cplusplus
638}
639#endif
640
641#endif /* !APACHE_HTTP_REQUEST_H */
#define AP_DECLARE_DATA
Definition ap_config.h:89
#define AP_FN_ATTR_SENTINEL
Definition ap_config.h:185
#define AP_DECLARE(type)
Definition ap_config.h:67
#define AP_DECLARE_HOOK(ret, name, args)
Definition ap_hooks.h:74
APR-UTIL registration of functions exported by modules.
request_rec * r
#define AP_CORE_DECLARE_NONSTD
Definition httpd.h:390
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)
Definition request.c:2179
void ap_setup_auth_internal(apr_pool_t *ptemp)
Definition request.c:2141
void ap_clear_auth_internal(void)
Definition request.c:2135
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)
Definition request.c:2107
void ap_allow_methods(request_rec *r, int reset,...)
int ap_directory_walk(request_rec *r)
Definition request.c:661
int ap_some_auth_required(request_rec *r)
Definition request.c:2125
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)
Definition request.c:2206
int ap_file_walk(request_rec *r)
Definition request.c:1655
void ap_hook_check_access(ap_HOOK_access_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
Definition request.c:2194
request_rec * ap_sub_req_lookup_dirent(const apr_finfo_t *finfo, const request_rec *r, int subtype, ap_filter_t *next_filter)
Definition request.c:2304
void ap_process_request(request_rec *r)
int ap_if_walk(request_rec *r)
Definition request.c:1992
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)
Definition request.c:2297
int ap_run_sub_req(request_rec *r)
Definition request.c:2528
const apr_bucket_type_t ap_bucket_type_eor
Definition eor_bucket.c:107
int ap_is_initial_req(request_rec *r)
Definition request.c:2567
request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r, ap_filter_t *next_filter)
Definition request.c:2433
int ap_process_request_internal(request_rec *r)
Definition request.c:187
apr_bucket * ap_bucket_eor_create(apr_bucket_alloc_t *list, request_rec *r)
Definition eor_bucket.c:68
void ap_process_request_after_handler(request_rec *r)
void ap_allow_standard_methods(request_rec *r, int reset,...)
void ap_destroy_sub_req(request_rec *r)
Definition request.c:2547
request_rec * ap_sub_req_method_uri(const char *method, const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
Definition request.c:2242
void ap_hook_check_authn(ap_HOOK_check_user_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
Definition request.c:2218
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_bucket * ap_bucket_eor_make(apr_bucket *b, request_rec *r)
Definition eor_bucket.c:56
apr_status_t ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb, unsigned int max_blank_lines)
int ap_some_authn_required(request_rec *r)
Definition request.c:127
int ap_location_walk(request_rec *r)
Definition request.c:1452
void ap_hook_check_authz(ap_HOOK_auth_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
Definition request.c:2230
void ap_update_mtime(request_rec *r, apr_time_t dependency_mtime)
Definition request.c:2557
apr_file_t * f
const char *const const char *const * aszSucc
Definition apr_hooks.h:346
const char *const * aszPre
Definition apr_hooks.h:345
void(*) const char *const const char *const in nOrder)
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
const char int apr_pool_t * pool
Definition apr_cstr.h:84
const apr_array_header_t * list
Definition apr_cstr.h:105
int apr_status_t
Definition apr_errno.h:44
int type
const char apr_int32_t wanted
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
Definition apr_poll.h:195
apr_pool_t * b
Definition apr_pools.h:529
apr_int64_t apr_time_t
Definition apr_time.h:45
int ap_HOOK_access_checker_ex_t(request_rec *r)
int ap_HOOK_check_user_id_t(request_rec *r)
int ap_HOOK_access_checker_t(request_rec *r)
int ap_HOOK_auth_checker_t(request_rec *r)
static apr_status_t reset(proxy_balancer *balancer, server_rec *s)
static OCSP_REQUEST * create_request(X509_STORE_CTX *ctx, X509 *cert, OCSP_CERTID **certid, server_rec *s, apr_pool_t *p, SSLSrvConfigRec *sc)
The representation of a filter chain.
Structure to store things which are per connection.
Definition httpd.h:1152
A structure that represents the current request.
Definition httpd.h:845
Apache filter library.