From d5c622995334ad79752b7e1bd56e3cc2dc36023e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 12 Oct 2015 11:57:42 +0000 Subject: [PATCH] core: follow up to r1708084. We don't want to process the subrequest either in ap_sub_req_method_uri() if the quick-handler returned an error (or any final status). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1708095 13f79535-47bb-0310-9956-ffa450edef68 --- server/request.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/server/request.c b/server/request.c index 9955b5e9f9..35de21d848 100644 --- a/server/request.c +++ b/server/request.c @@ -2228,8 +2228,7 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, ap_filter_t *next_filter) { request_rec *rnew; - /* Initialise res, to avoid a gcc warning */ - int res = HTTP_INTERNAL_SERVER_ERROR; + int res = DECLINED; char *udir; rnew = make_sub_request(r, next_filter); @@ -2246,6 +2245,9 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, udir = ap_escape_uri(rnew->pool, udir); /* re-escape it */ ap_parse_uri(rnew, ap_make_full_path(rnew->pool, udir, new_uri)); } + if (ap_is_HTTP_ERROR(rnew->status)) { + return rnew; + } /* We cannot return NULL without violating the API. So just turn this * subrequest into a 500 to indicate the failure. */ @@ -2267,11 +2269,11 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, if (next_filter) { res = ap_run_quick_handler(rnew, 1); } - - if (next_filter == NULL || res != OK) { - if ((res = ap_process_request_internal(rnew))) { - rnew->status = res; - } + if (res == DECLINED) { + res = ap_process_request_internal(rnew); + } + if (res) { + rnew->status = res; } return rnew; -- 2.40.0