summaryrefslogtreecommitdiffstats
path: root/cache.c
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-03-16 13:08:56 +0100
committerMartin Nagy <mnagy@redhat.com>2009-03-16 15:45:47 +0100
commiteb28d6d9ffe5c18f51a7288f3d536087991c1158 (patch)
treeb1a5f163161818949e355f3a71cfa9956b986e48 /cache.c
parente5f852b66a5fc39216321bff98a7cf3ca398b7a8 (diff)
downloadldap_driver_testing-eb28d6d9ffe5c18f51a7288f3d536087991c1158.tar.gz
ldap_driver_testing-eb28d6d9ffe5c18f51a7288f3d536087991c1158.tar.xz
ldap_driver_testing-eb28d6d9ffe5c18f51a7288f3d536087991c1158.zip
Add discard_from_cache().
This function will delete a named entry from cache, if it exists and if caching is turned on.
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cache.c b/cache.c
index 69d8545..e775cf3 100644
--- a/cache.c
+++ b/cache.c
@@ -192,3 +192,22 @@ cached_ldap_rdatalist_get(isc_mem_t *mctx, ldap_cache_t *cache,
cleanup:
return result;
}
+
+isc_result_t
+discard_from_cache(ldap_cache_t *cache, dns_name_t *name)
+{
+ isc_result_t result;
+
+ REQUIRE(cache != NULL);
+ REQUIRE(name != NULL);
+
+ if (cache->rbt == NULL)
+ result = ISC_R_SUCCESS;
+ else
+ result = dns_rbt_deletename(cache->rbt, name, ISC_FALSE);
+
+ if (result == ISC_R_NOTFOUND)
+ result = ISC_R_SUCCESS;
+
+ return result;
+}