From e88faedf1781b287ecc02e4f4031760d06e4ec30 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 2 Jan 2002 21:34:50 +0000 Subject: [PATCH] Eliminate a duplicate absolute path test, and NEVER serve a request for an APR_DIR file from the cache when we have path_info, it is a contradition (APR_DIR always forces dir_walk to gather the next segment from path_info, even if it is APR_NOFILE, until we have no path_info.) So we can't use a predetermined filename/path_info combo, ever, if the filename resolves to an APR_DIR. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92706 13f79535-47bb-0310-9956-ffa450edef68 --- server/request.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server/request.c b/server/request.c index 381390878a..712b132259 100644 --- a/server/request.c +++ b/server/request.c @@ -454,15 +454,15 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) /* XXX: Better (faster) tests needed!!! * * "OK" as a response to a real problem is not _OK_, but to allow broken - * modules to proceed, we will permit the not-a-path filename to pass here. - * We must catch it later if it's heading for the core handler. Leave an - * INFO note here for module debugging. + * modules to proceed, we will permit the not-a-path filename to pass the + * following two tests. This behavior may be revoked in future versions + * of Apache. We still must catch it later if it's heading for the core + * handler. Leave INFO notes here for module debugging. */ - if (r->filename == NULL || !ap_os_is_path_absolute(r->pool, r->filename)) { + if (r->filename == NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r, - "Module bug? Request filename path %s is missing " - "or not absolute for uri %s", - r->filename ? r->filename : "", r->uri); + "Module bug? Request filename is missing for URI %s", + r->uri); return OK; } @@ -513,8 +513,10 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) * and the vhost's list of directory sections hasn't changed, * we can skip rewalking the directory_walk entries. */ - if (cache->cached && ((r->finfo.filetype == APR_REG) - || (r->finfo.filetype == APR_DIR)) + if (cache->cached + && ((r->finfo.filetype == APR_REG) + || ((r->finfo.filetype == APR_DIR) + && (!r->path_info || !*r->path_info))) && (cache->dir_conf_tested == sec_ent) && (strcmp(entry_dir, cache->cached) == 0)) { /* Well this looks really familiar! If our end-result (per_dir_result) -- 2.40.0