Permalink
Browse files

Fix the return values on mod_cache_socache's store_headers() implemen…

…tation

to return APR errors codes and not DECLINED. We are committed to using this
implementation by this point, and any error should force us to stand down.
Submitted by: trawick
Reviewed by: minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1391396 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 95c7f4c commit b27e589a7dc15575c3550440cc51b345e382d5f9 @minfrin minfrin committed Sep 28, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 modules/cache/mod_cache_socache.c
@@ -827,8 +827,8 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r,
varray = apr_array_make(r->pool, 6, sizeof(char*));
tokens_to_array(r->pool, vary, varray);
- if (APR_SUCCESS != store_array(varray, sobj->buffer,
- sobj->buffer_len, &slider)) {
+ if (APR_SUCCESS != (rv = store_array(varray, sobj->buffer,
+ sobj->buffer_len, &slider))) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(XXXXX)
"buffer too small for Vary array, caching aborted: %s",
obj->key);
@@ -843,7 +843,7 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r,
"could not acquire lock, ignoring: %s", obj->key);
apr_pool_destroy(sobj->pool);
sobj->pool = NULL;
- return DECLINED;
+ return status;
}
}
rv = conf->provider->socache_provider->store(
@@ -858,15 +858,15 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r,
"could not release lock, ignoring: %s", obj->key);
apr_pool_destroy(sobj->pool);
sobj->pool = NULL;
- return DECLINED;
+ return rv;
}
}
if (rv != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(XXXXX)
"Vary not written to cache, ignoring: %s", obj->key);
apr_pool_destroy(sobj->pool);
sobj->pool = NULL;
- return DECLINED;
+ return rv;
}
obj->key = sobj->key = regen_key(r->pool, sobj->headers_in, varray,

0 comments on commit b27e589

Please sign in to comment.