ASF Bugzilla – Attachment 18158 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]
mod_disk_cache: check if allowed to cache the file before caching
httpd-2.2.1-disk_cache-p2-checkbefore.patch (text/plain), 1.94 KB, created by
Niklas Edmundsson
on 2006-04-23 08:36:09 UTC
(
hide
)
Description:
mod_disk_cache: check if allowed to cache the file before caching
Filename:
MIME Type:
Creator:
Niklas Edmundsson
Created:
2006-04-23 08:36:09 UTC
Size:
1.94 KB
patch
obsolete
>diff -ru ../p1-logstring/modules/cache/mod_disk_cache.c ./modules/cache/mod_disk_cache.c >--- ../p1-logstring/modules/cache/mod_disk_cache.c 2006-04-23 10:10:51.000000000 +0200 >+++ ./modules/cache/mod_disk_cache.c 2006-04-23 10:24:12.000000000 +0200 >@@ -961,10 +961,41 @@ > { > apr_bucket *e; > apr_status_t rv; >+ apr_off_t len; > disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj; > disk_cache_conf *conf = ap_get_module_config(r->server->module_config, > &disk_cache_module); > >+ if(r->no_cache) { >+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, >+ "disk_cache: store_body called for URL %s even though" >+ "no_cache is set", h->cache_obj->key); >+ file_cache_errorcleanup(dobj, r); >+ return APR_EGENERAL; >+ } >+ >+ /* Note, can return -1 if len unknown so don't trust it too hard */ >+ apr_brigade_length(bb, 0, &len); >+ >+ if (len > conf->maxfs) { >+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, >+ "disk_cache: URL %s failed the size check " >+ "(%" APR_OFF_T_FMT ">%" APR_SIZE_T_FMT ")", >+ h->cache_obj->key, len, conf->maxfs); >+ /* Remove the intermediate cache file and return non-APR_SUCCESS */ >+ file_cache_errorcleanup(dobj, r); >+ return APR_EGENERAL; >+ } >+ if (len >= 0 && len < conf->minfs) { >+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, >+ "disk_cache: URL %s failed the size check " >+ "(%" APR_OFF_T_FMT "<%" APR_SIZE_T_FMT ")", >+ h->cache_obj->key, len, conf->minfs); >+ /* Remove the intermediate cache file and return non-APR_SUCCESS */ >+ file_cache_errorcleanup(dobj, r); >+ return APR_EGENERAL; >+ } >+ > /* We write to a temp file and then atomically rename the file over > * in file_cache_el_final(). > */
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