SilcServerEntry
silc_idlist_find_server_by_name(SilcIDList id_list, char *name,
- SilcBool registered, SilcIDCacheEntry *ret_entry)
+ SilcBool registered,
+ SilcIDCacheEntry *ret_entry)
{
SilcIDCacheEntry id_cache = NULL;
SilcServerEntry server;
return FALSE;
}
+/* ID Cache destructor */
+
+void silc_idlist_server_destructor(SilcIDCache cache,
+ SilcIDCacheEntry entry,
+ void *dest_context,
+ void *app_context)
+{
+ silc_free(entry->name);
+}
+
/******************************************************************************
Client entry functions
void *dest_context,
void *app_context)
{
- SilcServer server = app_context;
+ SilcServer server = dest_context;
SilcClientEntry client;
client = (SilcClientEntry)entry->context;
if (client) {
- /* Remove this client from the public key hash list */
+ /* Remove client's public key from repository, this will free it too. */
if (client->data.public_key)
- silc_hash_table_del_by_context(server->pk_hash,
- client->data.public_key, client);
+ silc_skr_del_public_key(server->repository, client->data.public_key,
+ client);
assert(!silc_hash_table_count(client->channels));
silc_free(client->nickname);
silc_free(client->userinfo);
silc_free(client->id);
silc_free(client->attrs);
- if (client->data.public_key)
- silc_pkcs_public_key_free(client->data.public_key);
silc_hash_table_free(client->channels);
memset(client, 'A', sizeof(*client));
NULL, NULL, NULL, TRUE);
if (!silc_idcache_add(id_list->channels, channel_namec,
- (void *)channel->id, (void *)channel /*XXX, expire */)) {
+ (void *)channel->id, (void *)channel)) {
silc_hmac_free(channel->hmac);
silc_hash_table_free(channel->user_list);
silc_free(channel);
return channel;
}
+/* ID Cache destructor */
+
+void silc_idlist_channel_destructor(SilcIDCache cache,
+ SilcIDCacheEntry entry,
+ void *dest_context,
+ void *app_context)
+{
+ silc_free(entry->name);
+}
+
/* Foreach callbcak to free all users from the channel when deleting a
channel entry. */