From: Bill Stoddard Date: Wed, 13 Mar 2002 19:41:56 +0000 (+0000) Subject: Move the quick_handler comment to the new quick handler location. Do not X-Git-Tag: CHANGES~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6752a95e45a0a4cadc8f3cbbf19309d39405f06f;p=apache Move the quick_handler comment to the new quick handler location. Do not call quick handler on a dirent subrequest. This fixes a nasty problem in mod_cache where it was serving up content on a dirent subrequest. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93915 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_request.c b/modules/http/http_request.c index efe843ac55..852f55a362 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -239,24 +239,6 @@ void ap_process_request(request_rec *r) { int access_status; - /* Give quick handlers a shot at serving the request on the fast - * path, bypassing all of the other Apache hooks. - * - * This hook was added to enable serving files out of a URI keyed - * content cache ( e.g., Mike Abbott's Quick Shortcut Cache, - * described here: http://oss.sgi.com/projects/apache/mod_qsc.html ) - * - * It may have other uses as well, such as routing requests directly to - * content handlers that have the ability to grok HTTP and do their - * own access checking, etc (e.g. servlet engines). - * - * Use this hook with extreme care and only if you know what you are - * doing. - * - * Consider moving this hook to after the first location_walk in order - * to enable the quick handler to make decisions based on config - * directives in Location blocks. - */ access_status = ap_process_request_internal(r); if (access_status == OK) { access_status = ap_invoke_handler(r); diff --git a/server/request.c b/server/request.c index 507a30a35f..b9d082122b 100644 --- a/server/request.c +++ b/server/request.c @@ -145,13 +145,33 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r) int file_req = (r->main && r->filename); int access_status; - access_status = ap_run_quick_handler(r); - if (access_status != DECLINED) { - if (access_status == OK) { - return DONE; - } - else { - return access_status; + /* Give quick handlers a shot at serving the request on the fast + * path, bypassing all of the other Apache hooks. Bypass the call + * for dirent subrequests (any other cases to bypass?) + * + * This hook was added to enable serving files out of a URI keyed + * content cache ( e.g., Mike Abbott's Quick Shortcut Cache, + * described here: http://oss.sgi.com/projects/apache/mod_qsc.html ) + * + * It may have other uses as well, such as routing requests directly to + * content handlers that have the ability to grok HTTP and do their + * own access checking, etc (e.g. servlet engines). + * + * Use this hook with extreme care and only if you know what you are + * doing. This hook is available to (non dirent) subrequests. + */ + if (!(r->main && r->filename && r->finfo.filetype)) { + /* TODO?: Add a field to the request_rec explicitly identifying + * the type of subrequest? + */ + access_status = ap_run_quick_handler(r); + if (access_status != DECLINED) { + if (access_status == OK) { + return DONE; + } + else { + return access_status; + } } }