From a312fb463ab0d4673f6666a8224765082c941005 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 4 Aug 2002 11:24:46 +0000 Subject: [PATCH] More checks for not having purge timeout for global clients that are on channel. --- CHANGES | 6 ++++++ apps/silcd/command_reply.c | 11 +++++++++++ apps/silcd/server_util.c | 6 ++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 2578595a..7050f2c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Sun Aug 4 13:23:40 CEST 2002 Pekka Riikonen + + * More fixed for not having purge timeout for global clients + that are on channel. Affected files silcd/command_reply.c + and server_util.c. + Sun Jul 14 21:33:32 EEST 2002 Pekka Riikonen * Do not process commands if the sock->user_data is NULL. diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index 64ca3aba..ecf6f3c2 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -401,6 +401,17 @@ silc_server_command_reply_whowas_save(SilcServerCommandReplyContext cmd) client, 0, NULL); } + /* If client is global and is not on any channel then add that we'll + expire the entry after a while. */ + if (global) { + silc_idlist_find_client_by_id(server->global_list, client->id, + FALSE, &cache); + if (!silc_hash_table_count(client->channels)) + cache->expire = SILC_ID_CACHE_EXPIRE_DEF; + else + cache->expire = 0; + } + silc_free(client_id); return TRUE; diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index fd6671b8..27077f68 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -444,8 +444,7 @@ silc_server_update_clients_by_real_server(SilcServer server, if (local) { SILC_LOG_DEBUG(("Moving client to global list")); silc_idcache_add(server->global_list->clients, client_cache->name, - client_cache->id, client_cache->context, - client_cache->expire, NULL); + client_cache->id, client_cache->context, 0, NULL); silc_idcache_del_by_context(server->local_list->clients, client); } server_entry = server_entry->router; @@ -455,8 +454,7 @@ silc_server_update_clients_by_real_server(SilcServer server, if (server_entry->server_type != SILC_BACKUP_ROUTER && local) { SILC_LOG_DEBUG(("Moving client to global list")); silc_idcache_add(server->global_list->clients, client_cache->name, - client_cache->id, client_cache->context, - client_cache->expire, NULL); + client_cache->id, client_cache->context, 0, NULL); silc_idcache_del_by_context(server->local_list->clients, client); } } -- 2.24.0