X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Fsilcd%2Fidlist.c;h=a647c949d5dd8beb5f4bf1fe2d42577ec73e5b29;hp=8da1366274fc7cfd2f0841a95c8945de835615c8;hb=95fc2076c8fa714b5ab648073e51a22f1ca11508;hpb=3b006851d159de26c4d67d9b7037067812c2356c diff --git a/apps/silcd/idlist.c b/apps/silcd/idlist.c index 8da13662..a647c949 100644 --- a/apps/silcd/idlist.c +++ b/apps/silcd/idlist.c @@ -383,6 +383,8 @@ int silc_idlist_get_clients_by_nickname(SilcIDList id_list, char *nickname, *clients_count += i; + SILC_LOG_DEBUG(("Found %d clients", *clients_count)); + return TRUE; } @@ -404,6 +406,10 @@ int silc_idlist_get_clients_by_hash(SilcIDList id_list, char *nickname, silc_hash_make(md5hash, nickname, strlen(nickname), hash); + /* As the Client ID is hashed in the ID cache by hashing only the hash + from the Client ID, we can do a lookup with only the hash not the + other parts of the ID and get all the clients with that hash, ie. + with that nickname, as the hash is from the nickname. */ memset(&client_id, 0, sizeof(client_id)); memcpy(&client_id.hash, hash, sizeof(client_id.hash)); if (!silc_idcache_find_by_id(id_list->clients, &client_id, &list)) @@ -424,6 +430,8 @@ int silc_idlist_get_clients_by_hash(SilcIDList id_list, char *nickname, *clients_count += i; + SILC_LOG_DEBUG(("Found %d clients", *clients_count)); + return TRUE; }