Lines 659-664
static apr_status_t store_body(cache_han
Link Here
|
659 |
/* Was this the final bucket? If yes, close the body file and make sanity checks */ |
659 |
/* Was this the final bucket? If yes, close the body file and make sanity checks */ |
660 |
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(b))) { |
660 |
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(b))) { |
661 |
if (h->cache_obj->info.len <= 0) { |
661 |
if (h->cache_obj->info.len <= 0) { |
|
|
662 |
/* |
663 |
* If the target value of the content length is unknown |
664 |
* (h->cache_obj->info.len <= 0) check if connection has been aborted |
665 |
* by client to avoid caching incomplete request bodys. |
666 |
* This can happen with large responses from slow backends like |
667 |
* Tomcat via mod_jk. |
668 |
*/ |
669 |
if (r->connection->aborted) { |
670 |
ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server, |
671 |
"disk_cache: Discarding body for URL %s " |
672 |
"because connection has been aborted.", |
673 |
h->cache_obj->key); |
674 |
/* Remove the intermediate cache file and return non-APR_SUCCESS */ |
675 |
return file_cache_errorcleanup(dobj, r); |
676 |
} |
662 |
/* XXX Fixme: file_size isn't constrained by size_t. */ |
677 |
/* XXX Fixme: file_size isn't constrained by size_t. */ |
663 |
h->cache_obj->info.len = dobj->file_size; |
678 |
h->cache_obj->info.len = dobj->file_size; |
664 |
} |
679 |
} |