ASF Bugzilla – Attachment 21519 Details for
Bug 39380
mod_disk_cache eats memory, has no LFS support, etc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
FIX htcacheclean for mod_disk_cache jumbo patch - 2.2.6 version
patch_htcacheclean (text/plain), 5.34 KB, created by
Rafael Pereira
on 2008-02-13 05:52:57 UTC
(
hide
)
Description:
FIX htcacheclean for mod_disk_cache jumbo patch - 2.2.6 version
Filename:
MIME Type:
Creator:
Rafael Pereira
Created:
2008-02-13 05:52:57 UTC
Size:
5.34 KB
patch
obsolete
>diff -ru httpd-2.2.6/support/htcacheclean.c httpd-2.2.6_htcacheclean/support/htcacheclean.c >--- httpd-2.2.6/support/htcacheclean.c 2008-02-13 11:37:38.000000000 -0200 >+++ httpd-2.2.6_htcacheclean/support/htcacheclean.c 2008-02-12 11:47:35.000000000 -0200 >@@ -287,6 +287,7 @@ > int skip, retries; > disk_cache_info_t disk_info; > >+ > APR_RING_INIT(&anchor, _direntry, link); > apr_pool_create(&p, pool); > h = apr_hash_make(p); >@@ -379,6 +380,11 @@ > continue; > } > >+ if(strncasecmp(base + strlen(base) - sizeof(CACHE_HEADER_SUFFIX) + 1, CACHE_HEADER_SUFFIX, sizeof(CACHE_HEADER_SUFFIX))) { >+ continue; >+ } >+ >+ > if (!strncasecmp(base, AP_TEMPFILE_BASE, AP_TEMPFILE_BASELEN) > && strlen(base) == AP_TEMPFILE_NAMELEN) { > d->basename += skip; >@@ -421,10 +427,8 @@ > len = sizeof(format); > if (apr_file_read_full(fd, &format, len, > &len) == APR_SUCCESS) { >- if (format == DISK_FORMAT_VERSION) { >- apr_off_t offset = 0; >- >- apr_file_seek(fd, APR_SET, &offset); >+ if (format == DISK_FORMAT_VERSION) { >+ apr_off_t offset; > > len = sizeof(disk_cache_info_t); > >@@ -432,22 +436,28 @@ > &len) == APR_SUCCESS) { > e = apr_palloc(pool, sizeof(ENTRY)); > APR_RING_INSERT_TAIL(&root, e, _entry, link); >- e->expire = disk_info.expire; >+ e->expire = disk_info.expire; > e->response_time = disk_info.response_time; >- e->htime = d->htime; >- e->hsize = d->hsize; >+ // e->htime = d->htime; >+ //e->hsize = d->hsize; >+ e->htime = disk_info.date; >+ e->hsize = disk_info.file_size; > e->basename = apr_pstrdup(pool, d->basename); >- e->name = apr_palloc(pool, disk_info.name_len+1); >+ e->name = apr_palloc(pool, disk_info.bodyname_len+1); >+ offset = disk_info.name_len; >+ apr_file_seek(fd, APR_CUR, &offset); > if(apr_file_read_full(fd, e->name, >- disk_info.name_len, NULL) >+ disk_info.bodyname_len, NULL) > == APR_SUCCESS) > { >- e->name[disk_info.name_len] = '\0'; >+ e->name[disk_info.bodyname_len] = '\0'; > } > else { > e->name = "UNKNOWN"; > } >- apr_file_close(fd); >+ // apr_file_printf(errfile, "e-basename: %s e->name: %s, name_len: %d, body: %d, file: %d" >+ // APR_EOL_STR, e->basename, e->name, disk_info.name_len, disk_info.bodyname_len, disk_info.filename_len ); >+ apr_file_close(fd); > > break; > } >@@ -480,7 +490,9 @@ > current = apr_time_now(); > if (realclean || d->htime < current - deviation > || d->htime > current + deviation) { >- delete_entry(path, d->basename, p); >+ apr_file_printf(errfile, "header time %lld, current time %lld, deviation time %lld" >+ APR_EOL_STR, d->htime, current, deviation ); >+ delete_entry(path, d->basename, p); > unsolicited += d->hsize; > } > break; >@@ -520,6 +532,7 @@ > apr_off_t sum, total, entries, etotal; > ENTRY *e, *n, *oldest; > >+ > sum = 0; > entries = 0; > >@@ -547,6 +560,7 @@ > n = APR_RING_NEXT(e, link); > if (e->response_time > now || e->htime > now ) { > delete_entry(path, e->basename, pool); >+ delete_entry(path, e->name, pool); > sum -= e->hsize; > entries--; > APR_RING_REMOVE(e, link); >@@ -570,7 +584,8 @@ > n = APR_RING_NEXT(e, link); > if (e->expire != APR_DATE_BAD && e->expire < now) { > delete_entry(path, e->basename, pool); >- if(verbose > 1) { >+ delete_entry(path, e->name, pool); >+ if(verbose >= 1) { > apr_file_printf(errfile, "Expired: %s\n", e->name); > } > sum -= e->hsize; >@@ -607,7 +622,8 @@ > } > > delete_entry(path, oldest->basename, pool); >- if(verbose > 1) { >+ delete_entry(path, oldest->name, pool); >+ if(verbose >= 1) { > apr_file_printf(errfile, "Old: (%d s) " > "(%" APR_OFF_T_FMT " b) %s\n", > (int) apr_time_sec(apr_time_now() - oldest->htime), >@@ -912,7 +928,7 @@ > break; > } > >- if (dowork && !interrupted) { >+ if (dowork && !interrupted) { > if (!process_dir(path, instance) && !interrupted) { > purge(path, instance, max); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39380
:
18152
|
18154
|
18155
|
18157
|
18158
|
18159
|
18860
|
18861
|
18916
|
18968
|
18969
|
18979
|
18980
|
19418
|
20558
|
21016
|
21519
|
21715
|
22127