Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 54548 invoked by uid 500); 27 Mar 2001 19:19:08 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 54537 invoked by uid 500); 27 Mar 2001 19:19:08 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 27 Mar 2001 19:19:08 -0000 Message-ID: <20010327191908.54533.qmail@apache.org> From: stoddard@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server config.c stoddard 01/03/27 11:19:08 Modified: . CHANGES include http_config.h modules/http http_request.c server config.c Log: Performance: Add quick_handler hook. This hook is called at the very beginning of the request processing before location_walk, translate_name, etc. This hook is useful for URI keyed content caches like Mike Abbott's Quick Shortcut Cache. Revision Changes Path 1.151 +5 -0 httpd-2.0/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.150 retrieving revision 1.151 diff -u -r1.150 -r1.151 --- CHANGES 2001/03/26 15:39:39 1.150 +++ CHANGES 2001/03/27 19:19:07 1.151 @@ -1,4 +1,9 @@ Changes with Apache 2.0.16-dev + *) Performance: Add quick_handler hook. This hook is called at the + very beginning of the request processing before location_walk, + translate_name, etc. This hook is useful for URI keyed content + caches like Mike Abbott's Quick Shortcut Cache. + [Bill Stoddard] *) top_module global variable renamed to ap_top_module [Perl] 1.73 +10 -0 httpd-2.0/include/http_config.h Index: http_config.h =================================================================== RCS file: /home/cvs/httpd-2.0/include/http_config.h,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- http_config.h 2001/03/26 15:39:42 1.72 +++ http_config.h 2001/03/27 19:19:07 1.73 @@ -1003,6 +1003,16 @@ AP_DECLARE_HOOK(int,handler,(request_rec *r)) /** + * Run the quick handler functions for each module. The quick_handler + * is run before any other requests hooks are called (location_walk, + * directory_walk, access checking, et. al.). This hook was added + * to provide a quick way to serve content out of a URI keyed cache. + * @param r The request_rec + * @deffunc void ap_run_quick_handler(request_rec *r) + */ +AP_DECLARE_HOOK(int,quick_handler,(request_rec *r)) + +/** * Retrieve the optional functions for each module. * This is run immediately before the server starts. Optional functions should * be registered during the hook registration phase. 1.94 +30 -1 httpd-2.0/modules/http/http_request.c Index: http_request.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- http_request.c 2001/03/18 02:33:21 1.93 +++ http_request.c 2001/03/27 19:19:07 1.94 @@ -391,7 +391,36 @@ void ap_process_request(request_rec *r) { - process_request_internal(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_run_quick_handler(r); + if (access_status == OK) { + ap_finalize_request_protocol(r); + } + else if (access_status == DECLINED) { + process_request_internal(r); + } + else { + ap_die(access_status, r); + } /* * We want to flush the last packet if this isn't a pipelining connection 1.121 +3 -0 httpd-2.0/server/config.c Index: config.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/config.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- config.c 2001/03/26 15:39:49 1.120 +++ config.c 2001/03/27 19:19:08 1.121 @@ -111,6 +111,7 @@ APR_HOOK_LINK(open_logs) APR_HOOK_LINK(child_init) APR_HOOK_LINK(handler) + APR_HOOK_LINK(quick_handler) APR_HOOK_LINK(optional_fn_retrieve) ) @@ -129,6 +130,8 @@ (apr_pool_t *pchild, server_rec *s),(pchild,s)) AP_IMPLEMENT_HOOK_RUN_FIRST(int,handler,(request_rec *r), + (r),DECLINED) +AP_IMPLEMENT_HOOK_RUN_FIRST(int,quick_handler,(request_rec *r), (r),DECLINED) AP_IMPLEMENT_HOOK_VOID(optional_fn_retrieve,(void),())