Lines 961-970
Link Here
|
961 |
{ |
961 |
{ |
962 |
apr_bucket *e; |
962 |
apr_bucket *e; |
963 |
apr_status_t rv; |
963 |
apr_status_t rv; |
|
|
964 |
apr_off_t len; |
964 |
disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj; |
965 |
disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj; |
965 |
disk_cache_conf *conf = ap_get_module_config(r->server->module_config, |
966 |
disk_cache_conf *conf = ap_get_module_config(r->server->module_config, |
966 |
&disk_cache_module); |
967 |
&disk_cache_module); |
967 |
|
968 |
|
|
|
969 |
if(r->no_cache) { |
970 |
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, |
971 |
"disk_cache: store_body called for URL %s even though" |
972 |
"no_cache is set", h->cache_obj->key); |
973 |
file_cache_errorcleanup(dobj, r); |
974 |
return APR_EGENERAL; |
975 |
} |
976 |
|
977 |
/* Note, can return -1 if len unknown so don't trust it too hard */ |
978 |
apr_brigade_length(bb, 0, &len); |
979 |
|
980 |
if (len > conf->maxfs) { |
981 |
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, |
982 |
"disk_cache: URL %s failed the size check " |
983 |
"(%" APR_OFF_T_FMT ">%" APR_SIZE_T_FMT ")", |
984 |
h->cache_obj->key, len, conf->maxfs); |
985 |
/* Remove the intermediate cache file and return non-APR_SUCCESS */ |
986 |
file_cache_errorcleanup(dobj, r); |
987 |
return APR_EGENERAL; |
988 |
} |
989 |
if (len >= 0 && len < conf->minfs) { |
990 |
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, |
991 |
"disk_cache: URL %s failed the size check " |
992 |
"(%" APR_OFF_T_FMT "<%" APR_SIZE_T_FMT ")", |
993 |
h->cache_obj->key, len, conf->minfs); |
994 |
/* Remove the intermediate cache file and return non-APR_SUCCESS */ |
995 |
file_cache_errorcleanup(dobj, r); |
996 |
return APR_EGENERAL; |
997 |
} |
998 |
|
968 |
/* We write to a temp file and then atomically rename the file over |
999 |
/* We write to a temp file and then atomically rename the file over |
969 |
* in file_cache_el_final(). |
1000 |
* in file_cache_el_final(). |
970 |
*/ |
1001 |
*/ |