]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1876484, r1876493 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 23 Apr 2020 12:33:04 +0000 (12:33 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 23 Apr 2020 12:33:04 +0000 (12:33 +0000)
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

STATUS
support/htcacheclean.c

diff --git a/STATUS b/STATUS
index b0ce7da6ee6a7dd15a3712442a837b5f1e167231..da4990aebc1f4e8de876fbaf56d023a6fe8c776d 100644 (file)
--- 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
index 8692377d0c4281a875b908d600af8d823dc638cb..958ba6d4ba34ab0460d9a7fcc681908c3578766b 100644 (file)
@@ -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;
         }