mirror of
https://github.com/apache/httpd.git
synced 2025-08-10 02:56:11 +00:00
* Check return value of apr_bucket_read when storing the response body to disk.
Delete already cached data if an error occurs. Submitted by: Brian Akins <brian.akins turner.com> Reviewed by: Ruediger Pluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@389697 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
10
modules/cache/mod_disk_cache.c
vendored
10
modules/cache/mod_disk_cache.c
vendored
@ -984,7 +984,15 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
|
||||
{
|
||||
const char *str;
|
||||
apr_size_t length, written;
|
||||
apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
|
||||
rv = apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
|
||||
if (rv != APR_SUCCESS) {
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
|
||||
"cache_disk: Error when reading bucket for URL %s",
|
||||
h->cache_obj->key);
|
||||
/* Remove the intermediate cache file and return non-APR_SUCCESS */
|
||||
file_cache_errorcleanup(dobj, r);
|
||||
return APR_EGENERAL;
|
||||
}
|
||||
rv = apr_file_write_full(dobj->tfd, str, length, &written);
|
||||
if (rv != APR_SUCCESS) {
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
|
||||
|
Reference in New Issue
Block a user