From: Nick Kew Date: Wed, 23 Jun 2010 15:04:57 +0000 (+0000) Subject: Fix return values from socache modules when a key is not found in cache X-Git-Tag: 2.3.7~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f877509b612076266a667255cd883535f7b31577;p=apache Fix return values from socache modules when a key is not found in cache git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@957235 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8f38f3d453..a192b6332e 100644 --- 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. diff --git a/modules/cache/mod_socache_dbm.c b/modules/cache/mod_socache_dbm.c index fc3349b93a..615e81be7a 100644 --- a/modules/cache/mod_socache_dbm.c +++ b/modules/cache/mod_socache_dbm.c @@ -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); diff --git a/modules/cache/mod_socache_dc.c b/modules/cache/mod_socache_dc.c index 06c52d7afe..674a6a7bcf 100644 --- a/modules/cache/mod_socache_dc.c +++ b/modules/cache/mod_socache_dc.c @@ -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"); diff --git a/modules/cache/mod_socache_shmcb.c b/modules/cache/mod_socache_shmcb.c index 835b6c5983..6163fc9c50 100644 --- a/modules/cache/mod_socache_shmcb.c +++ b/modules/cache/mod_socache_shmcb.c @@ -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,