From: Graham Leggett Date: Fri, 28 Sep 2012 11:05:55 +0000 (+0000) Subject: Fix the return values on mod_cache_socache's store_headers() implementation X-Git-Tag: 2.5.0-alpha~6264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22c26238201e0eb7a1453685fe707a00ce3867b4;p=thirdparty%2Fapache%2Fhttpd.git Fix the return values on mod_cache_socache's store_headers() implementation 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 --- diff --git a/modules/cache/mod_cache_socache.c b/modules/cache/mod_cache_socache.c index 20534b22232..3f4bcf9e220 100644 --- a/modules/cache/mod_cache_socache.c +++ b/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,7 +858,7 @@ 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) { @@ -866,7 +866,7 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, "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,