gcc mentioned that rv was returned without being set, and after
looking a bit I noticed a few other glitches.

Any comments on the untested patch?

(I also see that the APLOGNO() invocations need to be fixed, but I
haven't looked further.)

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/
Index: modules/cache/mod_cache_socache.c
===================================================================
--- modules/cache/mod_cache_socache.c   (revision 1391013)
+++ modules/cache/mod_cache_socache.c   (working copy)
@@ -834,7 +834,7 @@
                         obj->key);
                 apr_pool_destroy(sobj->pool);
                 sobj->pool = NULL;
-                return rv;
+                return APR_EGENERAL;
             }
             if (socache_mutex) {
                 apr_status_t status = apr_global_mutex_lock(socache_mutex);
@@ -843,7 +843,7 @@
                             "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(
@@ -852,13 +852,12 @@
                     (unsigned char *) sobj->buffer, (unsigned int) slider,
                     sobj->pool);
             if (socache_mutex) {
-                rv = apr_global_mutex_unlock(socache_mutex);
-                if (rv != APR_SUCCESS) {
-                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(XXXXX)
+                apr_status_t status = apr_global_mutex_unlock(socache_mutex);
+                if (status != APR_SUCCESS) {
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, 
APLOGNO(XXXXX)
                             "could not release lock, ignoring: %s", obj->key);
                     apr_pool_destroy(sobj->pool);
                     sobj->pool = NULL;
-                    return DECLINED;
                 }
             }
             if (rv != APR_SUCCESS) {
@@ -866,7 +865,7 @@
                         "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,

Reply via email to