From d4c82f83ea76eafe13b4fd3d8cba588ca737ba5b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jun 2001 21:48:53 +0000 Subject: [PATCH] Pull harry, difficult to read sub_req_common_validation() into its own function so that it's apparent that this is common code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89447 13f79535-47bb-0310-9956-ffa450edef68 --- server/request.c | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/server/request.c b/server/request.c index ce08d9d14e..027f34fa4c 100644 --- a/server/request.c +++ b/server/request.c @@ -832,6 +832,28 @@ static void fill_in_sub_req_vars(request_rec *rnew, const request_rec *r, ap_set_sub_req_protocol(rnew, r); } +static int sub_req_common_validation(request_rec *rnew) +{ + int res; + + if ((( ap_satisfies(rnew) == SATISFY_ALL + || ap_satisfies(rnew) == SATISFY_NOSPEC) + ? ((res = ap_run_access_checker(rnew)) + || (ap_some_auth_required(rnew) + && ((res = ap_run_check_user_id(rnew)) + || (res = ap_run_auth_checker(rnew))))) + : ((res = ap_run_access_checker(rnew)) + && (!ap_some_auth_required(rnew) + || ((res = ap_run_check_user_id(rnew)) + || (res = ap_run_auth_checker(rnew))))) + ) + || (res = ap_run_type_checker(rnew)) + || (res = ap_run_fixups(rnew))) + return res; + else + return 0; +} + AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) { @@ -928,20 +950,7 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, if ((res = directory_walk(rnew)) || (res = file_walk(rnew)) || (res = location_walk(rnew)) - || ((ap_satisfies(rnew) == SATISFY_ALL - || ap_satisfies(rnew) == SATISFY_NOSPEC) - ? ((res = ap_run_access_checker(rnew)) - || (ap_some_auth_required(rnew) - && ((res = ap_run_check_user_id(rnew)) - || (res = ap_run_auth_checker(rnew))))) - : ((res = ap_run_access_checker(rnew)) - && (!ap_some_auth_required(rnew) - || ((res = ap_run_check_user_id(rnew)) - || (res = ap_run_auth_checker(rnew))))) - ) - || (res = ap_run_type_checker(rnew)) - || (res = ap_run_fixups(rnew)) - ) { + || (res = sub_req_common_validation(rnew))) { rnew->status = res; } return rnew; @@ -1039,6 +1048,11 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent, return rnew; } } + + if (res || (res = sub_req_common_validation(rnew))) { + rnew->status = res; + } + return rnew; } AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, @@ -1142,21 +1156,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, } } - if (res - || ((ap_satisfies(rnew) == SATISFY_ALL - || ap_satisfies(rnew) == SATISFY_NOSPEC) - ? ((res = ap_run_access_checker(rnew)) - || (ap_some_auth_required(rnew) - && ((res = ap_run_check_user_id(rnew)) - || (res = ap_run_auth_checker(rnew))))) - : ((res = ap_run_access_checker(rnew)) - && (!ap_some_auth_required(rnew) - || ((res = ap_run_check_user_id(rnew)) - || (res = ap_run_auth_checker(rnew))))) - ) - || (res = ap_run_type_checker(rnew)) - || (res = ap_run_fixups(rnew)) - ) { + if (res || (res = sub_req_common_validation(rnew))) { rnew->status = res; } return rnew; -- 2.40.0