You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2012/09/28 13:05:55 UTC

svn commit: r1391396 - /httpd/httpd/trunk/modules/cache/mod_cache_socache.c

Author: minfrin
Date: Fri Sep 28 11:05:55 2012
New Revision: 1391396

URL: http://svn.apache.org/viewvc?rev=1391396&view=rev
Log:
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

Modified:
    httpd/httpd/trunk/modules/cache/mod_cache_socache.c

Modified: httpd/httpd/trunk/modules/cache/mod_cache_socache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache_socache.c?rev=1391396&r1=1391395&r2=1391396&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache_socache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache_socache.c Fri Sep 28 11:05:55 2012
@@ -827,8 +827,8 @@ static apr_status_t store_headers(cache_
             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_
                             "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_
                             "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_
                         "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,