diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2001-08-26 01:43:19 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2001-08-26 01:43:19 +0200 |
commit | 307ab558867a23cf46bdc3eb69e44c769e9adf98 (patch) | |
tree | 0c2f313234a7f2e1ab14b0a7882fa05e975c4326 /server/request.c | |
parent | BUCKETS SMS PHASE 1 (diff) | |
download | apache2-307ab558867a23cf46bdc3eb69e44c769e9adf98.tar.xz apache2-307ab558867a23cf46bdc3eb69e44c769e9adf98.zip |
Introduce the map_to_storage hook, which allows modules to bypass
the directory_walk and file_walk for non-file requests. TRACE
shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.
A seperate patch to mod_proxy is required to short circuit both the
TRACE and directory_walk/file_walk stuff. That patch is next.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90665 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | server/request.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/server/request.c b/server/request.c index 793a16d74d..ef7041456f 100644 --- a/server/request.c +++ b/server/request.c @@ -93,6 +93,7 @@ APR_HOOK_STRUCT( APR_HOOK_LINK(translate_name) + APR_HOOK_LINK(map_to_storage) APR_HOOK_LINK(check_user_id) APR_HOOK_LINK(fixups) APR_HOOK_LINK(type_checker) @@ -104,6 +105,8 @@ APR_HOOK_STRUCT( AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name, (request_rec *r),(r),DECLINED) +AP_IMPLEMENT_HOOK_RUN_FIRST(int,map_to_storage, + (request_rec *r),(r),DECLINED) AP_IMPLEMENT_HOOK_RUN_FIRST(int,check_user_id, (request_rec *r),(r),DECLINED) AP_IMPLEMENT_HOOK_RUN_ALL(int,fixups, @@ -379,7 +382,7 @@ static int get_path_info(request_rec *r) return OK; } -AP_DECLARE(int) directory_walk(request_rec *r) +AP_DECLARE(int) ap_directory_walk(request_rec *r) { core_server_config *sconf = ap_get_module_config(r->server->module_config, &core_module); @@ -455,7 +458,7 @@ AP_DECLARE(int) directory_walk(request_rec *r) return OK; } - /* The replacement code [above] for directory_walk eliminates this issue. + /* The replacement code [below] for directory_walk eliminates this issue. */ res = get_path_info(r); if (res != OK) { @@ -699,7 +702,7 @@ AP_DECLARE(int) directory_walk(request_rec *r) * they change, all the way down. */ -AP_DECLARE(int) directory_walk(request_rec *r) +AP_DECLARE(int) ap_directory_walk(request_rec *r) { core_server_config *sconf = ap_get_module_config(r->server->module_config, &core_module); @@ -1035,7 +1038,8 @@ AP_DECLARE(int) directory_walk(request_rec *r) #endif /* defined REPLACE_PATH_INFO_METHOD */ -AP_DECLARE(int) location_walk(request_rec *r) + +AP_DECLARE(int) ap_location_walk(request_rec *r) { core_server_config *sconf = ap_get_module_config(r->server->module_config, &core_module); @@ -1106,7 +1110,7 @@ AP_DECLARE(int) location_walk(request_rec *r) return OK; } -AP_DECLARE(int) file_walk(request_rec *r) +AP_DECLARE(int) ap_file_walk(request_rec *r) { core_dir_config *conf = ap_get_module_config(r->per_dir_config, &core_module); @@ -1168,7 +1172,6 @@ AP_DECLARE(int) file_walk(request_rec *r) return OK; } - /***************************************************************** * * The sub_request mechanism. @@ -1318,7 +1321,7 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, ap_getparents(rnew->uri); - if ((res = location_walk(rnew))) { + if ((res = ap_location_walk(rnew))) { rnew->status = res; return rnew; } @@ -1340,9 +1343,9 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, * from location_walk() above */ - if ((res = directory_walk(rnew)) - || (res = file_walk(rnew)) - || (res = location_walk(rnew)) + if ((res = ap_directory_walk(rnew)) + || (res = ap_file_walk(rnew)) + || (res = ap_location_walk(rnew)) || (res = sub_req_common_validation(rnew))) { rnew->status = res; } @@ -1439,17 +1442,17 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent, * directory_walk */ if (rnew->finfo.filetype == APR_DIR) { - if (!(res = directory_walk(rnew))) - if (!(res = file_walk(rnew))) - res = location_walk(rnew); + if (!(res = ap_directory_walk(rnew))) + if (!(res = ap_file_walk(rnew))) + res = ap_location_walk(rnew); } else if (rnew->finfo.filetype == APR_REG || !rnew->finfo.filetype) { /* * do a file_walk, if it doesn't change the per_dir_config then * we know that we don't have to redo all the access checks */ - if ( !(res = file_walk(rnew)) - && !(res = location_walk(rnew)) + if ( !(res = ap_file_walk(rnew)) + && !(res = ap_location_walk(rnew)) && (rnew->per_dir_config == r->per_dir_config)) { if ( (res = ap_run_type_checker(rnew)) @@ -1558,17 +1561,17 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, * directory_walk */ if (rnew->finfo.filetype == APR_DIR) { - if (!(res = directory_walk(rnew))) - if (!(res = file_walk(rnew))) - res = location_walk(rnew); + if (!(res = ap_directory_walk(rnew))) + if (!(res = ap_file_walk(rnew))) + res = ap_location_walk(rnew); } else if (rnew->finfo.filetype == APR_REG || !rnew->finfo.filetype) { /* * do a file_walk, if it doesn't change the per_dir_config then * we know that we don't have to redo all the access checks */ - if ( !(res = file_walk(rnew)) - && !(res = location_walk(rnew)) + if ( !(res = ap_file_walk(rnew)) + && !(res = ap_location_walk(rnew)) && (rnew->per_dir_config == r->per_dir_config)) { if ( (res = ap_run_type_checker(rnew)) @@ -1595,9 +1598,9 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, */ rnew->uri = "INTERNALLY GENERATED file-relative req"; rnew->per_dir_config = r->server->lookup_defaults; - res = directory_walk(rnew); + res = ap_directory_walk(rnew); if (!res) { - res = file_walk(rnew); + res = ap_file_walk(rnew); } } |