]> granicus.if.org Git - apache/commitdiff
Fix return values from socache modules when a key is not found in cache
authorNick Kew <niq@apache.org>
Wed, 23 Jun 2010 15:04:57 +0000 (15:04 +0000)
committerNick Kew <niq@apache.org>
Wed, 23 Jun 2010 15:04:57 +0000 (15:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@957235 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/mod_socache_dbm.c
modules/cache/mod_socache_dc.c
modules/cache/mod_socache_shmcb.c

diff --git a/CHANGES b/CHANGES
index 8f38f3d453d2c8551dbed0a32ad9ed65cf8109b0..a192b6332e2d52649808f4d199e2ef9fc8a9ee9c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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.
index fc3349b93a735a8d67bf307af5da354c151c4c43..615e81be7a5ac3a7ae754d68192fd8d59519f7e9 100644 (file)
@@ -291,7 +291,7 @@ static apr_status_t socache_dbm_retrieve(ap_socache_instance_t *ctx, server_rec
     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);
index 06c52d7afe6e862077d23805f903077b8091e4dd..674a6a7bcf23611bb6a5150a7fedcfe5930e75fb 100644 (file)
@@ -121,7 +121,7 @@ static apr_status_t socache_dc_retrieve(ap_socache_instance_t *ctx, server_rec *
     /* 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");
index 835b6c5983934db775316e17eee04197774b9ad5..6163fc9c50c6cf80dd8714bb172b5e08952c3562 100644 (file)
@@ -518,7 +518,7 @@ static apr_status_t socache_shmcb_retrieve(ap_socache_instance_t *ctx,
     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,