Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 55803 invoked from network); 20 Sep 2006 02:34:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Sep 2006 02:34:43 -0000 Received: (qmail 29186 invoked by uid 500); 20 Sep 2006 02:34:22 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29130 invoked by uid 500); 20 Sep 2006 02:34:22 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 29101 invoked by uid 99); 20 Sep 2006 02:34:22 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2006 19:34:22 -0700 X-ASF-Spam-Status: No, hits=0.1 required=5.0 tests=FORGED_RCVD_HELO Received: from ([65.99.219.155:2679] helo=haxent.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 28/13-00639-BA8A0154 for ; Tue, 19 Sep 2006 19:34:19 -0700 Received: from montefiori.dyndns.org (unknown [201.21.156.184]) by haxent.com (Postfix) with ESMTP id 8BC21274B0 for ; Tue, 19 Sep 2006 23:34:12 -0300 (BRT) Received: by montefiori.dyndns.org (Postfix, from userid 500) id 32D8D1090A8; Tue, 19 Sep 2006 23:34:42 -0300 (BRT) Message-Id: <20060920023441.673007000@haxent.com.br> References: <20060920023353.514118000@haxent.com.br> User-Agent: quilt/0.45-1 Date: Tue, 19 Sep 2006 23:34:01 -0300 From: Davi Arnaut To: dev@httpd.apache.org Subject: [patch 08/16] dont delete empty cache directories Content-Disposition: inline; filename=008.patch X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Don't delete empty cache directories, it is too expensive and unnecessary. Later they can be removed with htcacheclean. Index: modules/cache/mod_disk_cache.c =================================================================== --- modules/cache/mod_disk_cache.c.orig +++ modules/cache/mod_disk_cache.c @@ -579,45 +579,6 @@ } } - /* now delete directories as far as possible up to our cache root */ - if (dobj->root) { - const char *str_to_copy; - - str_to_copy = dobj->hdrsfile ? dobj->hdrsfile : dobj->datafile; - if (str_to_copy) { - char *dir, *slash, *q; - - dir = apr_pstrdup(p, str_to_copy); - - /* remove filename */ - slash = strrchr(dir, '/'); - *slash = '\0'; - - /* - * now walk our way back to the cache root, delete everything - * in the way as far as possible - * - * Note: due to the way we constructed the file names in - * header_file and data_file, we are guaranteed that the - * cache_root is suffixed by at least one '/' which will be - * turned into a terminating null by this loop. Therefore, - * we won't either delete or go above our cache root. - */ - for (q = dir + dobj->root_len; *q ; ) { - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, - "disk_cache: Deleting directory %s from cache", - dir); - - rc = apr_dir_remove(dir, p); - if (rc != APR_SUCCESS && !APR_STATUS_IS_ENOENT(rc)) { - break; - } - slash = strrchr(q, '/'); - *slash = '\0'; - } - } - } - return OK; } --