+Sun May 20 13:45:58 EEST 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+ * silc_idcache_purge_by_context deletes the entry now by context
+ as it is supposed to do. Affected file lib/silccore/idcache.c.
+
+ * Send the ERR_NO_SUCH_NICK in the WHOIS command reply if the
+ client is not anymore valid (WHOWAS givens the info) and not
+ the ERR_NO_SUCH_CLIENT_ID if the nickname still exists.
+
Sat May 19 16:30:03 EEST 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
* Removed the `data' and `data_len' arguments from the ID Cache
if (entry->data.registered == FALSE) {
if (clients_count == 1) {
- SilcBuffer idp = silc_id_payload_encode(entry->id, SILC_ID_CLIENT);
- silc_server_command_send_status_data(cmd, SILC_COMMAND_WHOIS,
- SILC_STATUS_ERR_NO_SUCH_CLIENT_ID,
- 2, idp->data, idp->len);
- silc_buffer_free(idp);
+ if (entry->nickname) {
+ silc_server_command_send_status_data(cmd, SILC_COMMAND_WHOIS,
+ SILC_STATUS_ERR_NO_SUCH_NICK,
+ 3, entry->nickname,
+ strlen(entry->nickname));
+ } else {
+ SilcBuffer idp = silc_id_payload_encode(entry->id, SILC_ID_CLIENT);
+ silc_server_command_send_status_data(cmd, SILC_COMMAND_WHOIS,
+ SILC_STATUS_ERR_NO_SUCH_CLIENT_ID,
+ 2, idp->data, idp->len);
+ silc_buffer_free(idp);
+ }
}
continue;
}
*clients_count += i;
+ SILC_LOG_DEBUG(("Found %d clients", *clients_count));
+
return TRUE;
}
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))
*clients_count += i;
+ SILC_LOG_DEBUG(("Found %d clients", *clients_count));
+
return TRUE;
}
SILC_GET32_MSB(mode, client_mode_list->data);
/* Check if we have this client cached already. */
- if (!silc_idcache_find_by_id_one_ext(conn->client_cache, (void *)client_id,
+ if (!silc_idcache_find_by_id_one_ext(conn->client_cache,
+ (void *)client_id,
NULL, NULL,
silc_hash_client_id_compare, NULL,
&id_cache)) {
SILC_GET32_MSB(mode, client_mode_list->data);
/* Check if we have this client cached already. */
- if (!silc_idcache_find_by_id_one_ext(conn->client_cache, (void *)client_id,
+ if (!silc_idcache_find_by_id_one_ext(conn->client_cache,
+ (void *)client_id,
NULL, NULL,
silc_hash_client_id_compare, NULL,
&id_cache)) {
if (id_type == SILC_ID_CLIENT) {
client_id = silc_id_payload_get_id(idp);
- if (!silc_idcache_find_by_id_one_ext(conn->client_cache, (void *)client_id,
+ if (!silc_idcache_find_by_id_one_ext(conn->client_cache,
+ (void *)client_id,
NULL, NULL,
silc_hash_client_id_compare, NULL,
&id_cache))
int i = 0;
/* Find ID from cache */
- if (!silc_idcache_find_by_name(conn->client_cache, nickname,
- &list))
+ if (!silc_idcache_find_by_name(conn->client_cache, nickname, &list))
return NULL;
if (!silc_idcache_list_count(list)) {
SilcClientEntry entry = NULL;
/* Find ID from cache */
- if (!silc_idcache_find_by_name(conn->client_cache, nickname,
- &list)) {
+ if (!silc_idcache_find_by_name(conn->client_cache, nickname, &list)) {
identify:
if (query) {
bool silc_idcache_purge_by_context(SilcIDCache cache, void *context)
{
SilcIDCacheEntry entry;
+ bool ret = FALSE;
if (!silc_hash_table_find(cache->context_table, context, NULL,
(void *)&entry))
if (cache->destructor)
cache->destructor(cache, entry);
- return silc_idcache_del(cache, entry);
+ if (entry->name)
+ ret = silc_hash_table_del_by_context(cache->name_table, entry->name,
+ entry);
+ if (entry->context)
+ ret = silc_hash_table_del(cache->context_table, entry->context);
+ if (entry->id)
+ ret = silc_hash_table_del_by_context(cache->id_table, entry->id, entry);
+
+ return ret;
}
/* Callback that is called by the hash table routine when traversing
# temporary files (including these prepare* scripts) are removed.
#
-SILC_VERSION=0.2.4
+SILC_VERSION=0.2.5
version=$1
if test "$version" = ""; then