From: Jim Jagielski Date: Fri, 15 Aug 2008 22:12:47 +0000 (+0000) Subject: Merge r683626, r685112 from trunk: X-Git-Tag: 2.2.10~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0492553bcb3e958a4f3f9b2c83044906414a31a;p=thirdparty%2Fapache%2Fhttpd.git Merge r683626, r685112 from trunk: mod_dav_fs: Retrieve minimal system information about directory entries when walking a DAV fs, resolving a performance degradation on Windows. PR: 45464 * modules/dav/fs/repos.c (DAV_FINFO_MASK): Define macro. (dav_fs_walker): Use DAV_FINFO_MASK when stat'ing the directory member during the walk. Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@686395 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b43bbd0faef..bd0308e3a4f 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,15 @@ Changes with Apache 2.2.10 mod_proxy_ftp: Prevent XSS attacks when using wildcards in the path of the FTP URL. Discovered by Marc Bevand of Rapid7. [Ruediger Pluem] + *) mod_dav_fs: Retrieve minimal system information about directory + entries when walking a DAV fs, resolving a performance degradation on + Windows. PR 45464. [Jeff Trawick] + + *) mod_cgid: Pass along empty command line arguments from an ISINDEX + query that has consecutive '+' characters in the QUERY_STRING, + matching the behavior of mod_cgi. + [Eric Covener] + *) mod_headers: Prevent Header edit from processing only the first header of possibly multiple headers with the same name and deleting the remaining ones. PR 45333. [Ruediger Pluem] diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index a532e6e94fa..bb1978815b0 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -119,9 +119,19 @@ enum { ** Does this platform support an executable flag? ** ** ### need a way to portably abstract this query +** +** DAV_FINFO_MASK gives the appropriate mask to use for the stat call +** used to get file attributes. */ #ifndef WIN32 #define DAV_FS_HAS_EXECUTABLE +#define DAV_FINFO_MASK (APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_INODE | \ + APR_FINFO_SIZE | APR_FINFO_CTIME | APR_FINFO_MTIME | \ + APR_FINFO_PROT) +#else +/* as above, but without APR_FINFO_PROT */ +#define DAV_FINFO_MASK (APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_INODE | \ + APR_FINFO_SIZE | APR_FINFO_CTIME | APR_FINFO_MTIME) #endif /* @@ -1479,10 +1489,8 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth) /* append this file onto the path buffer (copy null term) */ dav_buffer_place_mem(pool, &fsctx->path1, dirent.name, len + 1, 0); - - /* ### Optimize me, dirent can give us what we need! */ status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, - APR_FINFO_NORM | APR_FINFO_LINK, pool); + DAV_FINFO_MASK, pool); if (status != APR_SUCCESS && status != APR_INCOMPLETE) { /* woah! where'd it go? */ /* ### should have a better error here */