aboutsummaryrefslogtreecommitdiff
path: root/src/ccapi
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2008-08-20 18:46:46 +0000
committerAlexandra Ellwood <lxs@mit.edu>2008-08-20 18:46:46 +0000
commit7ac8c2023422a829a3fdfa81b576a2910c232458 (patch)
tree4212661bda590586bc5b4783c13c99177d9ad388 /src/ccapi
parent19093104b11c62dbacb8ce985404862b8eaf0664 (diff)
downloadkrb5-7ac8c2023422a829a3fdfa81b576a2910c232458.zip
krb5-7ac8c2023422a829a3fdfa81b576a2910c232458.tar.gz
krb5-7ac8c2023422a829a3fdfa81b576a2910c232458.tar.bz2
Notify clients on ccache deletion
Clients watching a ccache or the cache collection should get a notification when the ccache is destroyed. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20678 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi')
-rw-r--r--src/ccapi/server/ccs_cache_collection.c15
-rw-r--r--src/ccapi/server/ccs_ccache.c9
-rw-r--r--src/ccapi/server/ccs_ccache.h3
3 files changed, 20 insertions, 7 deletions
diff --git a/src/ccapi/server/ccs_cache_collection.c b/src/ccapi/server/ccs_cache_collection.c
index 02d4d8f..a1531bd 100644
--- a/src/ccapi/server/ccs_cache_collection.c
+++ b/src/ccapi/server/ccs_cache_collection.c
@@ -320,15 +320,28 @@ cc_int32 ccs_cache_collection_destroy_ccache (ccs_cache_collection_t io_cache_c
cci_identifier_t in_identifier)
{
cc_int32 err = ccNoError;
+ ccs_ccache_t ccache = NULL;
if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
if (!in_identifier ) { err = cci_check_error (ccErrBadParam); }
if (!err) {
+ err = ccs_cache_collection_find_ccache (io_cache_collection,
+ in_identifier,
+ &ccache);
+ }
+
+ if (!err) {
+ /* Notify before deletion because after deletion the ccache
+ * will no longer exist (and won't know about its clients) */
+ err = ccs_ccache_changed (ccache, io_cache_collection);
+ }
+
+ if (!err) {
err = ccs_ccache_list_remove (io_cache_collection->ccaches,
in_identifier);
}
-
+
return cci_check_error (err);
}
diff --git a/src/ccapi/server/ccs_ccache.c b/src/ccapi/server/ccs_ccache.c
index c2e36bf..4ebf2a0 100644
--- a/src/ccapi/server/ccs_ccache.c
+++ b/src/ccapi/server/ccs_ccache.c
@@ -45,9 +45,6 @@ struct ccs_ccache_d {
struct ccs_ccache_d ccs_ccache_initializer = { NULL, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL };
-static cc_int32 ccs_ccache_changed (ccs_ccache_t io_ccache,
- ccs_cache_collection_t io_cache_collection);
-
/* ------------------------------------------------------------------------ */
cc_int32 ccs_ccache_new (ccs_ccache_t *out_ccache,
@@ -313,8 +310,8 @@ cc_int32 ccs_ccache_compare_name (ccs_ccache_t in_ccache,
/* ------------------------------------------------------------------------ */
-static cc_int32 ccs_ccache_changed (ccs_ccache_t io_ccache,
- ccs_cache_collection_t io_cache_collection)
+cc_int32 ccs_ccache_changed (ccs_ccache_t io_ccache,
+ ccs_cache_collection_t io_cache_collection)
{
cc_int32 err = ccNoError;
cci_stream_t reply_data = NULL;
@@ -361,7 +358,7 @@ static cc_int32 ccs_ccache_changed (ccs_ccache_t io_ccache,
}
}
}
-
+
cci_stream_release (reply_data);
return cci_check_error (err);
diff --git a/src/ccapi/server/ccs_ccache.h b/src/ccapi/server/ccs_ccache.h
index ba32752..3e9f6ae 100644
--- a/src/ccapi/server/ccs_ccache.h
+++ b/src/ccapi/server/ccs_ccache.h
@@ -46,6 +46,9 @@ cc_int32 ccs_ccache_swap_contents (ccs_ccache_t io_source_ccache,
cc_int32 ccs_ccache_release (ccs_ccache_t io_ccache);
+cc_int32 ccs_ccache_changed (ccs_ccache_t io_ccache,
+ ccs_cache_collection_t io_cache_collection);
+
cc_int32 ccs_ccache_compare_identifier (ccs_ccache_t in_ccache,
cci_identifier_t in_identifier,
cc_uint32 *out_equal);