Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 9057 invoked from network); 9 Feb 2010 04:54:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 04:54:10 -0000 Received: (qmail 14521 invoked by uid 500); 9 Feb 2010 04:54:09 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 14410 invoked by uid 500); 9 Feb 2010 04:54:09 -0000 Mailing-List: contact cvs-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 cvs@httpd.apache.org Received: (qmail 14401 invoked by uid 99); 9 Feb 2010 04:54:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 04:54:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 04:54:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0736923888BD; Tue, 9 Feb 2010 04:53:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r907933 - /httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Date: Tue, 09 Feb 2010 04:53:47 -0000 To: cvs@httpd.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100209045348.0736923888BD@eris.apache.org> Author: wrowe Date: Tue Feb 9 04:53:47 2010 New Revision: 907933 URL: http://svn.apache.org/viewvc?rev=907933&view=rev Log: Fix inadvertent changes and be more verbose and correct in logging Modified: httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Modified: httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c?rev=907933&r1=907932&r2=907933&view=diff ============================================================================== --- httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c (original) +++ httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Tue Feb 9 04:53:47 2010 @@ -656,48 +656,6 @@ "we now have %u socache entries", subcache->idx_used); } -static void shmcb_subcache_iterate(server_rec *s, SHMCBHeader *header, - SHMCBSubcache *subcache) -{ - apr_time_t now = apr_time_now(); - unsigned int loop = 0; - unsigned int new_idx_pos = subcache->idx_pos; - SHMCBIndex *idx = NULL; - - while (loop < subcache->idx_used) { - idx = SHMCB_INDEX(subcache, new_idx_pos); - if (idx->expires > now) - /* it hasn't expired yet, we're done iterating */ - break; - loop++; - new_idx_pos = SHMCB_CYCLIC_INCREMENT(new_idx_pos, 1, header->index_num); - } - if (!loop) - /* Nothing to do */ - return; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "will be expiring %u socache entries", loop); - if (loop == subcache->idx_used) { - /* We're expiring everything, piece of cake */ - subcache->idx_used = 0; - subcache->data_used = 0; - } else { - /* There remain other indexes, so we can use idx to adjust 'data' */ - unsigned int diff = SHMCB_CYCLIC_SPACE(subcache->data_pos, - idx->data_pos, - header->subcache_data_size); - /* Adjust the indexes */ - subcache->idx_used -= loop; - subcache->idx_pos = new_idx_pos; - /* Adjust the data area */ - subcache->data_used -= diff; - subcache->data_pos = idx->data_pos; - } - header->stat_expiries += loop; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "we now have %u socache entries", subcache->idx_used); -} - static int shmcb_subcache_store(server_rec *s, SHMCBHeader *header, SHMCBSubcache *subcache, unsigned char *data, unsigned int data_len, @@ -831,11 +789,11 @@ SHMCB_DATA(header, subcache), idx->data_pos, id, idx->id_len) == 0) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "match at idx=%d, data=%d", pos, idx->data_pos); if (idx->expires > now) { unsigned int data_offset; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "match at idx=%d, data=%d", pos, idx->data_pos); /* Find the offset of the data segment, after the id */ data_offset = SHMCB_CYCLIC_INCREMENT(idx->data_pos, @@ -855,7 +813,7 @@ /* Already stale, quietly remove and treat as not-found */ idx->removed = 1; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "shmcb_subcache_remove removing expired entry"); + "shmcb_subcache_retrieve discarding expired entry"); return -1; } } @@ -872,8 +830,7 @@ static int shmcb_subcache_remove(server_rec *s, SHMCBHeader *header, SHMCBSubcache *subcache, const unsigned char *id, - unsigned int idlen, - apr_time_t now) + unsigned int idlen) { unsigned int pos; unsigned int loop = 0; @@ -890,10 +847,11 @@ idx->data_pos, id, idx->id_len) == 0) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "possible match at idx=%d, data=%d", pos, idx->data_pos); + /* Found the matching entry, remove it quietly. */ idx->removed = 1; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "shmcb_subcache_remove removing matching entry"); + "shmcb_subcache_remove removing matching entry"); return 0; } /* Increment */