diff options
Diffstat (limited to 'modules/cache/mod_disk_cache.c')
-rw-r--r-- | modules/cache/mod_disk_cache.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c index 15e333c0..92c5ad75 100644 --- a/modules/cache/mod_disk_cache.c +++ b/modules/cache/mod_disk_cache.c @@ -1006,7 +1006,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r, if (dobj->file_size > conf->maxfs) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "cache_disk: URL %s failed the size check " - "(%" APR_OFF_T_FMT ">%" APR_SIZE_T_FMT ")", + "(%" APR_OFF_T_FMT " > %" APR_OFF_T_FMT ")", h->cache_obj->key, dobj->file_size, conf->maxfs); /* Remove the intermediate cache file and return non-APR_SUCCESS */ file_cache_errorcleanup(dobj, r); @@ -1030,7 +1030,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r, if (dobj->file_size < conf->minfs) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "cache_disk: URL %s failed the size check " - "(%" APR_OFF_T_FMT "<%" APR_SIZE_T_FMT ")", + "(%" APR_OFF_T_FMT " < %" APR_OFF_T_FMT ")", h->cache_obj->key, dobj->file_size, conf->minfs); /* Remove the intermediate cache file and return non-APR_SUCCESS */ file_cache_errorcleanup(dobj, r); @@ -1117,15 +1117,25 @@ static const char { disk_cache_conf *conf = ap_get_module_config(parms->server->module_config, &disk_cache_module); - conf->minfs = atoi(arg); + + if (apr_strtoff(&conf->minfs, arg, NULL, 0) != APR_SUCCESS || + conf->minfs < 0) + { + return "CacheMinFileSize argument must be a non-negative integer representing the min size of a file to cache in bytes."; + } return NULL; } + static const char *set_cache_maxfs(cmd_parms *parms, void *in_struct_ptr, const char *arg) { disk_cache_conf *conf = ap_get_module_config(parms->server->module_config, &disk_cache_module); - conf->maxfs = atoi(arg); + if (apr_strtoff(&conf->maxfs, arg, NULL, 0) != APR_SUCCESS || + conf->maxfs < 0) + { + return "CacheMaxFileSize argument must be a non-negative integer representing the max size of a file to cache in bytes."; + } return NULL; } |