SILC_LOG_DEBUG(("Start"));
if (entry) {
- /* Remove from cache. Destructor callback deletes stuff. */
if (!silc_idcache_del_by_context(id_list->clients, entry)) {
SILC_LOG_DEBUG(("Unknown client, did not delete"));
return FALSE;
/* ID Cache destructor */
void silc_idlist_client_destructor(SilcIDCache cache,
- SilcIDCacheEntry entry)
+ SilcIDCacheEntry entry,
+ void *context)
{
+ SilcServer server = context;
SilcClientEntry client;
client = (SilcClientEntry)entry->context;
if (client) {
+ /* Remove this client from the public key hash list */
+ if (client->data.public_key)
+ silc_hash_table_del_by_context(server->pk_hash,
+ client->data.public_key, client);
+
assert(!silc_hash_table_count(client->channels));
silc_free(client->nickname);
silc_free(client->servername);
SilcIDList id_list, SilcClientID *old_id,
SilcClientID *new_id, const char *nickname);
void silc_idlist_client_destructor(SilcIDCache cache,
- SilcIDCacheEntry entry);
+ SilcIDCacheEntry entry,
+ void *context);
SilcChannelEntry
silc_idlist_add_channel(SilcIDList id_list, char *channel_name, int mode,
SilcChannelID *id, SilcServerEntry router,
/* Initialize ID caches */
server->local_list->clients =
silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor,
- FALSE, TRUE);
+ server, FALSE, TRUE);
server->local_list->servers =
- silc_idcache_alloc(0, SILC_ID_SERVER, NULL, FALSE, TRUE);
+ silc_idcache_alloc(0, SILC_ID_SERVER, NULL, NULL, FALSE, TRUE);
server->local_list->channels =
- silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, FALSE, TRUE);
+ silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, NULL, FALSE, TRUE);
/* These are allocated for normal server as well as these hold some
global information that the server has fetched from its router. For
router these are used as they are supposed to be used on router. */
server->global_list->clients =
silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor,
- FALSE, TRUE);
+ server, FALSE, TRUE);
server->global_list->servers =
- silc_idcache_alloc(0, SILC_ID_SERVER, NULL, FALSE, TRUE);
+ silc_idcache_alloc(0, SILC_ID_SERVER, NULL, NULL, FALSE, TRUE);
server->global_list->channels =
- silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, FALSE, TRUE);
+ silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, NULL, FALSE, TRUE);
/* Init watcher lists */
server->watcher_list =