diff options
| author | Alexandra Ellwood <lxs@mit.edu> | 2008-03-18 19:25:16 +0000 |
|---|---|---|
| committer | Alexandra Ellwood <lxs@mit.edu> | 2008-03-18 19:25:16 +0000 |
| commit | f8d4e9aaad429fd6fac6504a527ab0258f47b854 (patch) | |
| tree | 113cf627b1a1cbffd54f632670a8b06768012ca4 /src/ccapi/server/ccs_array.c | |
| parent | d8d990c823f7ba6070622acf5ff2d08af7c1d7a9 (diff) | |
| download | krb5-f8d4e9aaad429fd6fac6504a527ab0258f47b854.tar.gz krb5-f8d4e9aaad429fd6fac6504a527ab0258f47b854.tar.xz krb5-f8d4e9aaad429fd6fac6504a527ab0258f47b854.zip | |
CCacheServer should track client iterators
The CCacheServer needs to track client iterators so that if
a client crashes while iterating the resources on the server
for that iterator are freed.
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20279 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/server/ccs_array.c')
| -rw-r--r-- | src/ccapi/server/ccs_array.c | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/ccapi/server/ccs_array.c b/src/ccapi/server/ccs_array.c index 82aa02454..d5dd4adb2 100644 --- a/src/ccapi/server/ccs_array.c +++ b/src/ccapi/server/ccs_array.c @@ -212,7 +212,8 @@ cc_int32 ccs_callback_array_remove (ccs_callback_array_t io_array, cc_int32 ccs_callbackref_array_new (ccs_callbackref_array_t *out_array) { - return cci_array_new (out_array, NULL /* Just a reference, not owner */ ); + /* Ref arrays do not own their contents; pass NULL for release function */ + return cci_array_new (out_array, NULL); } /* ------------------------------------------------------------------------ */ @@ -253,3 +254,57 @@ cc_int32 ccs_callbackref_array_remove (ccs_callbackref_array_t io_array, { return cci_array_remove (io_array, in_position); } + +#ifdef TARGET_OS_MAC +#pragma mark - +#endif + +/* ------------------------------------------------------------------------ */ + +cc_int32 ccs_iteratorref_array_new (ccs_iteratorref_array_t *out_array) +{ + /* Ref arrays do not own their contents; pass NULL for release function */ + return cci_array_new (out_array, NULL); +} + +/* ------------------------------------------------------------------------ */ + +cc_int32 ccs_iteratorref_array_release (ccs_iteratorref_array_t io_array) +{ + return cci_array_release (io_array); +} + +/* ------------------------------------------------------------------------ */ + +cc_uint64 ccs_iteratorref_array_count (ccs_iteratorref_array_t in_array) +{ + return cci_array_count (in_array); +} + +/* ------------------------------------------------------------------------ */ + +ccs_generic_list_iterator_t ccs_iteratorref_array_object_at_index (ccs_iteratorref_array_t io_array, + cc_uint64 in_position) +{ + return (ccs_generic_list_iterator_t) cci_array_object_at_index (io_array, + in_position); +} + +/* ------------------------------------------------------------------------ */ + +cc_int32 ccs_iteratorref_array_insert (ccs_iteratorref_array_t io_array, + ccs_generic_list_iterator_t in_iterator, + cc_uint64 in_position) +{ + return cci_array_insert (io_array, + (cci_array_object_t) in_iterator, + in_position); +} + +/* ------------------------------------------------------------------------ */ + +cc_int32 ccs_iteratorref_array_remove (ccs_iteratorref_array_t io_array, + cc_uint64 in_position) +{ + return cci_array_remove (io_array, in_position); +} |
