ASF Bugzilla – Attachment 22437 Details for
Bug 30865
mod_disk_cache leaves many temporary files slowing file system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against trunk
30865.diff (text/plain), 1.76 KB, created by
Ruediger Pluem
on 2008-08-12 13:04:44 UTC
(
hide
)
Description:
Patch against trunk
Filename:
MIME Type:
Creator:
Ruediger Pluem
Created:
2008-08-12 13:04:44 UTC
Size:
1.76 KB
patch
obsolete
>Index: modules/cache/mod_disk_cache.c >=================================================================== >--- modules/cache/mod_disk_cache.c (Revision 684351) >+++ modules/cache/mod_disk_cache.c (Arbeitskopie) >@@ -66,6 +66,23 @@ > * Local static functions > */ > >+static apr_status_t cleanup_temp_file(void *data) { >+ const char *path = (const char *)data; >+ apr_pool_t *pool; >+ >+ /* >+ * Yes, this is a very ugly solution, but >+ * 1. This should not be called often. >+ * 2. We need a pool here and storing it in the data structure was not >+ * possible as this data structure would not be available later again >+ * for apr_pool_cleanup_kill calls to remove the cleanup again. >+ */ >+ apr_pool_create(&pool, NULL); >+ apr_file_remove(path, pool); >+ apr_pool_destroy(pool); >+ return APR_SUCCESS; >+} >+ > static char *header_file(apr_pool_t *p, disk_cache_conf *conf, > disk_cache_object_t *dobj, const char *name) > { >@@ -162,6 +179,7 @@ > > apr_file_close(dobj->tfd); > >+ apr_pool_cleanup_kill(r->pool, dobj->tempfile, cleanup_temp_file); > /* This assumes that the tempfile is on the same file system > * as the cache_root. If not, then we need a file copy/move > * rather than a rename. >@@ -190,6 +208,7 @@ > if (dobj->tfd) { > apr_file_close(dobj->tfd); > apr_file_remove(dobj->tempfile, r->pool); >+ apr_pool_cleanup_kill(r->pool, dobj->tempfile, cleanup_temp_file); > dobj->tfd = NULL; > } > >@@ -1011,6 +1030,8 @@ > return rv; > } > dobj->file_size = 0; >+ apr_pool_cleanup_register(r->pool, dobj->tempfile, >+ cleanup_temp_file, apr_pool_cleanup_null); > } > > for (e = APR_BRIGADE_FIRST(bb);
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 30865
: 22437