X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Fsilcd%2Fidlist.c;h=9acdd06844330fd6b2e7f93baaa55d344aa68687;hp=6a4d5f767068236bdd717a67a06bbd02beccebcf;hb=382d15d447b7a95390decfa783836ae4fe255b3d;hpb=3cf38201f9ffaad2da53757ed48a5546e1d03636 diff --git a/apps/silcd/idlist.c b/apps/silcd/idlist.c index 6a4d5f76..9acdd068 100644 --- a/apps/silcd/idlist.c +++ b/apps/silcd/idlist.c @@ -227,7 +227,7 @@ silc_idlist_find_server_by_conn(SilcIDList id_list, char *hostname, if (sock && ((sock->hostname && !strcasecmp(sock->hostname, hostname)) || (sock->ip && !strcasecmp(sock->ip, hostname))) - && sock->port == port) + && server->id->port == htons(port)) break; id_cache = NULL; @@ -295,8 +295,10 @@ int silc_idlist_del_server(SilcIDList id_list, SilcServerEntry entry) if (!silc_idcache_del_by_context(id_list->servers, entry)) return FALSE; - SILC_LOG_DEBUG(("Deleting server %s", entry->server_name ? - entry->server_name : "")); + SILC_LOG_DEBUG(("Deleting server %s id %s", entry->server_name ? + entry->server_name : "", + entry->id ? + silc_id_render(entry->id, SILC_ID_SERVER) : "")); /* Free data */ silc_free(entry->server_name); @@ -654,10 +656,6 @@ static void silc_idlist_del_channel_foreach(void *key, void *context, int silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry) { if (entry) { - SilcHashTableList htl; - SilcBuffer tmp; - SilcUInt32 type; - /* Remove from cache */ if (!silc_idcache_del_by_context(id_list->channels, entry)) return FALSE; @@ -676,31 +674,10 @@ int silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry) silc_free(entry->id); silc_free(entry->topic); - if (entry->invite_list) { - silc_hash_table_list(entry->invite_list, &htl); - while (silc_hash_table_get(&htl, (void **)&type, (void **)&tmp)) { - if (type == 1) { - silc_free((char *)tmp); - continue; - } - silc_buffer_free(tmp); - } - silc_hash_table_list_reset(&htl); + if (entry->invite_list) silc_hash_table_free(entry->invite_list); - } - - if (entry->ban_list) { - silc_hash_table_list(entry->ban_list, &htl); - while (silc_hash_table_get(&htl, (void **)&type, (void **)&tmp)) { - if (type == 1) { - silc_free((char *)tmp); - continue; - } - silc_buffer_free(tmp); - } - silc_hash_table_list_reset(&htl); + if (entry->ban_list) silc_hash_table_free(entry->ban_list); - } if (entry->channel_key) silc_cipher_free(entry->channel_key);