You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2020/06/23 11:27:48 UTC
svn commit: r1879114 - /httpd/httpd/trunk/server/request.c
Author: ylavic
Date: Tue Jun 23 11:27:48 2020
New Revision: 1879114
URL: http://svn.apache.org/viewvc?rev=1879114&view=rev
Log:
ap_location_walk/ap_directory_walk: copy the cached uri/filename.
Any in-place modification of r->uri of r->filename shouldn't affect the cache.
For instance, ap_process_request_internal() normalizes r->uri in place and yet
calls ap_location_walk() multiple times, which confuses caching.
Modified:
httpd/httpd/trunk/server/request.c
Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=1879114&r1=1879113&r2=1879114&view=diff
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Tue Jun 23 11:27:48 2020
@@ -1413,7 +1413,7 @@ AP_DECLARE(int) ap_directory_walk(reques
r->canonical_filename = r->filename;
if (r->finfo.filetype == APR_DIR) {
- cache->cached = r->filename;
+ cache->cached = apr_pstrdup(r->pool, r->filename);
}
else {
cache->cached = ap_make_dirstr_parent(r->pool, r->filename);
@@ -1497,7 +1497,7 @@ AP_DECLARE(int) ap_location_walk(request
apr_pool_t *rxpool = NULL;
cached &= auth_internal_per_conf;
- cache->cached = entry_uri;
+ cache->cached = apr_pstrdup(r->pool, entry_uri);
/* Go through the location entries, and check for matches.
* We apply the directive sections in given order, we should