You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2010/06/23 17:04:57 UTC

svn commit: r957235 - in /httpd/httpd/trunk: CHANGES modules/cache/mod_socache_dbm.c modules/cache/mod_socache_dc.c modules/cache/mod_socache_shmcb.c

Author: niq
Date: Wed Jun 23 15:04:57 2010
New Revision: 957235

URL: http://svn.apache.org/viewvc?rev=957235&view=rev
Log:
Fix return values from socache modules when a key is not found in cache

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
    httpd/httpd/trunk/modules/cache/mod_socache_dc.c
    httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=957235&r1=957234&r2=957235&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Jun 23 15:04:57 2010
@@ -2,6 +2,8 @@
 
 Changes with Apache 2.3.7
 
+  *) socache modules: return APR_NOTFOUND when a lookup is not found [Nick Kew]
+
   *) mod_authn_cache: new module [Nick Kew]
 
   *) core: Try to proceed with authorization even if authentication failed.

Modified: httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_dbm.c?rev=957235&r1=957234&r2=957235&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_dbm.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_dbm.c Wed Jun 23 15:04:57 2010
@@ -291,7 +291,7 @@ static apr_status_t socache_dbm_retrieve
     rc = apr_dbm_fetch(dbm, dbmkey, &dbmval);
     if (rc != APR_SUCCESS) {
         apr_dbm_close(dbm);
-        return rc;
+        return APR_NOTFOUND;
     }
     if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) {
         apr_dbm_close(dbm);

Modified: httpd/httpd/trunk/modules/cache/mod_socache_dc.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_dc.c?rev=957235&r1=957234&r2=957235&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_dc.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_dc.c Wed Jun 23 15:04:57 2010
@@ -121,7 +121,7 @@ static apr_status_t socache_dc_retrieve(
     /* Retrieve any corresponding session from the distributed cache context */
     if (!DC_CTX_get_session(ctx->dc, id, idlen, dest, *destlen, &data_len)) {
         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "distributed scache 'retrieve' MISS");
-        return APR_EGENERAL;
+        return APR_NOTFOUND;
     }
     if (data_len > *destlen) {
         ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "distributed scache 'retrieve' OVERFLOW");

Modified: httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c?rev=957235&r1=957234&r2=957235&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Wed Jun 23 15:04:57 2010
@@ -518,7 +518,7 @@ static apr_status_t socache_shmcb_retrie
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
                  "leaving socache_shmcb_retrieve successfully");
 
-    return rv == 0 ? APR_SUCCESS : APR_EGENERAL;
+    return rv == 0 ? APR_SUCCESS : APR_NOTFOUND;
 }
 
 static apr_status_t socache_shmcb_remove(ap_socache_instance_t *ctx,