Hi all,According to the method signature for the quick_handler hook, an int field called "lookup" is passed.
According to the API docs, the "lookup" field is described as: "Controls whether the caller actually wants content or not. lookup is set when the quick_handler is called out of ap_sub_req_lookup_uri()".
This description doesn't tell me exactly what lookup means: does (lookup == 1) mean the caller wants content? Does (lookup == 0) mean the caller want's content?
Looking at ap_sub_req_method_uri(), which is used to set up a subrequest (but not necessarily run it yet or at all), lookup is set to 1.
if (next_filter) {
res = ap_run_quick_handler(rnew, 1);
}
This would imply to me that (lookup == 1) means the caller *doesn't*
want content.
Looking at ap_run_sub_req(), which is used to actually run the request as set up by ap_sub_req_method_uri(), the quick handler is called again, with the lookup set to 0:
retval = ap_run_quick_handler(r, 0);
This would imply to me that (lookup == 0) means the caller *does* want
content.
However, in ap_run_sub_req(), we only run the quick handler if the content *isn't* a file or directory on disk:
if (!(r->filename && r->finfo.filetype)) {
retval = ap_run_quick_handler(r, 0);
}
Why does ap_run_sub_req() care whether the request is represented by a
file or directory on disk?
To describe the problem I am trying to solve: mod_cache refuses to cache the result of subrequests, and this is happening because the quick_handler is not running on subrequests with a lookup value of zero.
Would it be correct to run the quick handler for all requests, like so?
AP_DECLARE(int) ap_run_sub_req(request_rec *r)
{
int retval = DECLINED;
/* Run the quick handler if the subrequest is not a dirent or file
* subrequest
*/
- if (!(r->filename && r->finfo.filetype)) {
- retval = ap_run_quick_handler(r, 0);
+ retval = ap_run_quick_handler(r, 0);
- }
if (retval != OK) {
retval = ap_invoke_handler(r);
if (retval == DONE) {
retval = OK;
}
}
ap_finalize_sub_req_protocol(r);
return retval;
}
Regards,
Graham
--
smime.p7s
Description: S/MIME Cryptographic Signature
