More checks for not having purge timeout for global clients that
authorPekka Riikonen <priikone@silcnet.org>
Sun, 4 Aug 2002 11:24:46 +0000 (11:24 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 4 Aug 2002 11:24:46 +0000 (11:24 +0000)
are on channel.

CHANGES
apps/silcd/command_reply.c
apps/silcd/server_util.c

diff --git a/CHANGES b/CHANGES
index 2578595ab1098cbf5a36bd09fa4092779c45e689..7050f2c6fdc1d26a6a431e2bd766ec5ad96871c7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Sun Aug  4 13:23:40 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <priikone@silcnet.org>
 
        * Do not process commands if the sock->user_data is NULL.
index 64ca3abaa2f346835581670ffc80f00322d5e4b6..ecf6f3c22ff8614c6801093b7cee17d2ed9cc8c6 100644 (file)
@@ -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;
index fd6671b85d4b132fcb0be82296df670b0f3df30f..27077f6820c305de990c8f1a6e62d67727850a91 100644 (file)
@@ -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);
          }
        }