From: Jim Jagielski Date: Thu, 23 Apr 2020 12:33:04 +0000 (+0000) Subject: Merge r1876484, r1876493 from trunk: X-Git-Tag: 2.4.44~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9d02ac48f2502d133719f8a7d6433bd7fa644b3;p=thirdparty%2Fapache%2Fhttpd.git Merge r1876484, r1876493 from trunk: PR64313 htcacheclean: Empty directories in CacheRoot are still present even after using "-t" * Whitespace style fixes. No functional change. Submitted by: jfclere, rpluem Reviewed by: jailletc36, rpluem, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1876887 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index b0ce7da6ee6..da4990aebc1 100644 --- a/STATUS +++ b/STATUS @@ -135,19 +135,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) core: default_handler: cleanup outputed brigade before leaving. - trunk patch: - - http://svn.apache.org/r1783041 - 2.4.x patch: svn merge -c 1783041 ^/httpd/httpd/trunk . - +1: jailletc36, rpluem, jim - - *) htcacheclean: Empty directories in CacheRoot are still present even after using "-t". PR64313 - trunk patch: - - http://svn.apache.org/r1876484 - - http://svn.apache.org/r1876493 - 2.4.x patch: svn merge -c 1876484,1876493 ^/httpd/httpd/trunk . - +1: jfclere, rpluem, jim - *) mod_reqtimeout: cannot override default Virtualhost's mod_reqtimeout. PR64295 trunk patch: - http://svn.apache.org/r1876540 diff --git a/support/htcacheclean.c b/support/htcacheclean.c index 8692377d0c4..958ba6d4ba3 100644 --- a/support/htcacheclean.c +++ b/support/htcacheclean.c @@ -684,9 +684,19 @@ static int process_dir(char *path, apr_pool_t *pool, apr_off_t *nodes) } if (info.filetype == APR_DIR) { + char *dirpath = apr_pstrdup(p, d->basename); + if (process_dir(d->basename, pool, nodes)) { return 1; } + /* When given the -t option htcacheclean does not + * delete directories that are already empty, so we'll do that here + * since process_dir checks all the directories. + * If it fails, it likely means there was something else there. + */ + if (deldirs && !dryrun) { + apr_dir_remove(dirpath, p); + } continue; }