updates.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 27 Mar 2002 18:34:26 +0000 (18:34 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 27 Mar 2002 18:34:26 +0000 (18:34 +0000)
CHANGES
TODO
TODO-1.0
apps/silcd/packet_receive.c
lib/silcclient/client_notify.c
lib/silccore/silcidcache.c

diff --git a/CHANGES b/CHANGES
index ee399f1ca5c2dd00670f30e62ec78097fdb526cb..66a4a746296408d74cc4a446f14eeccd40eaa178 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,21 @@
+Wed Mar 27 19:43:16 EET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed the KICKED notify handling in client library to
+         correctly remove the channel and all entries from the
+         channel when I was kicked.  This bug crashed the client.
+
+         Fixed yet another but in KICKED notify handling to remove
+         the kicked client correctly from the channel.
+
+         Affected file is lib/silcclient/client_notify.c.
+
+       * Fixed a minor bug in looking up correct client entry
+         in KICKED notify in server.  Affected file is
+         silcd/packet_receive.c.
+
+       * Fixed the lib/silcmath/Makefile.am to include the MPI and GMP
+         sources correctly to distribution.  Fixes --with-gmp option.
+
 Wed Mar 27 00:07:11 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed a bug in the silc_client_nickname_format function that
diff --git a/TODO b/TODO
index 8c389dbc5d9f0704bbdf8a5635dffc312a7bcab1..7812eab4b1d008162da34bc32c2c45bed97b6f07 100644 (file)
--- a/TODO
+++ b/TODO
@@ -27,8 +27,6 @@ TODO/bugs In SILC Client Library
 TODO/bugs In SILC Server
 ========================
 
- o KICKing doesn't work.
-
  o Configuration file additions (Do this to 0.8.x):
 
        o Add incoming connection frequency, incoming connection frequency
@@ -74,11 +72,7 @@ TODO/bugs In SILC Libraries
 
  o WIN32 silc_net_create_connection_async does not work the same way
    than on Unix.  Do it with threads on WIN32.  The function works but
-   is not actually async currently.
-
- o EPOC specific additions/changes required:
-
-       o lib/silcutil/epoc routines missing or not completed.
+   is not actually async currently (Fix this to 1.0).
 
 
 TODO in Toolkit Documentation
index b843d59b626a2fed8dec97220b28da0366a75ed8..afda54a93b5b1cba192eff44076874341fab1851 100644 (file)
--- a/TODO-1.0
+++ b/TODO-1.0
@@ -159,6 +159,8 @@ least could be done.
 
  o EPOC specific additions/changes required:
 
+       o lib/silcutil/epoc routines missing or not completed.
+
        o The PKCS#1 also calls global RNG (even though it is not used 
          currently in SILC, the interface allows its use).
 
index 111f3b019ceaa1a0c536c41ec3070476a5cf485d..a3f0848a06252e265ac4bf486adbb317d49330a3 100644 (file)
@@ -404,8 +404,10 @@ void silc_server_notify(SilcServer server,
     if (!silc_server_client_on_channel(client, channel, &chl))
       goto out;
     if (chl->mode == SILC_CHANNEL_UMODE_NONE && 
-       channel->mode & SILC_CHANNEL_MODE_TOPIC)
+       channel->mode & SILC_CHANNEL_MODE_TOPIC) {
+      SILC_LOG_DEBUG(("Topic change is not allowed"));
       goto out;
+    }
 
     /* Change the topic */
     silc_free(channel->topic);
@@ -540,8 +542,10 @@ void silc_server_notify(SilcServer server,
     if (client) {
       if (!silc_server_client_on_channel(client, channel, &chl))
        goto out;
-      if (!silc_server_check_cmode_rights(server, channel, chl, mode))
+      if (!silc_server_check_cmode_rights(server, channel, chl, mode)) {
+       SILC_LOG_DEBUG(("CMODE change is not allowed"));
        goto out;
+      }
     }
 
     /* Send the same notify to the channel */
@@ -685,16 +689,20 @@ void silc_server_notify(SilcServer server,
        
        if (client != client2) {
          /* Sender must be operator */
-         if (chl->mode == SILC_CHANNEL_UMODE_NONE)
+         if (chl->mode == SILC_CHANNEL_UMODE_NONE) {
+           SILC_LOG_DEBUG(("CUMODE change is not allowed"));
            goto out;
+         }
 
          /* Check that target is on channel */
          if (!silc_server_client_on_channel(client2, channel, &chl))
            goto out;
 
          /* If target is founder mode change is not allowed. */
-         if (chl->mode & SILC_CHANNEL_UMODE_CHANFO)
+         if (chl->mode & SILC_CHANNEL_UMODE_CHANFO) {
+           SILC_LOG_DEBUG(("CUMODE change is not allowed"));
            goto out;
+         }
        }
       }
 
@@ -822,8 +830,10 @@ void silc_server_notify(SilcServer server,
     if (!silc_server_client_on_channel(client, channel, &chl))
       goto out;
     if (chl->mode == SILC_CHANNEL_UMODE_NONE && 
-       channel->mode & SILC_CHANNEL_MODE_INVITE)
+       channel->mode & SILC_CHANNEL_MODE_INVITE) {
+      SILC_LOG_DEBUG(("Inviting is not allowed"));
       goto out;
+    }
 
     /* Get the added invite */
     tmp = silc_argument_get_arg_type(args, 4, &tmp_len);
@@ -1128,8 +1138,8 @@ void silc_server_notify(SilcServer server,
       client2 = silc_idlist_find_client_by_id(server->global_list, 
                                              client_id, TRUE, NULL);
       if (!client2) {
-       client = silc_idlist_find_client_by_id(server->local_list, 
-                                              client_id, TRUE, NULL);
+       client2 = silc_idlist_find_client_by_id(server->local_list, 
+                                               client_id, TRUE, NULL);
        if (!client2) {
          silc_free(client_id);
          goto out;
@@ -1140,8 +1150,10 @@ void silc_server_notify(SilcServer server,
       /* Kicker must be operator on channel */
       if (!silc_server_client_on_channel(client2, channel, &chl))
        goto out;
-      if (chl->mode == SILC_CHANNEL_UMODE_NONE)
+      if (chl->mode == SILC_CHANNEL_UMODE_NONE) {
+       SILC_LOG_DEBUG(("Kicking is not allowed"));
        goto out;
+      }
     }
 
     /* Send to channel */
@@ -1249,8 +1261,10 @@ void silc_server_notify(SilcServer server,
     SILC_GET32_MSB(mode, tmp);
 
     /* Check that mode changing is allowed. */
-    if (!silc_server_check_umode_rights(server, client, mode))
+    if (!silc_server_check_umode_rights(server, client, mode)) {
+      SILC_LOG_DEBUG(("UMODE change is not allowed"));
       goto out;
+    }
 
     /* Change the mode */
     client->mode = mode;
index 89073dd98e99c0ee7aef19b992de8fefea537e31..5e13bf72dae90ce0c3860c576b47d06796dac597 100644 (file)
@@ -797,16 +797,19 @@ void silc_client_notify_by_server(SilcClient client,
     client->internal->ops->notify(client, conn, type, client_entry, tmp, 
                                  client_entry2, channel);
 
-    /* If I was kicked from channel, remove the channel */
+    /* Remove kicked client from channel */
     if (client_entry == conn->local_entry) {
+      /* If I was kicked from channel, remove the channel */
       if (conn->current_channel == channel)
        conn->current_channel = NULL;
-      silc_idcache_del_by_id(conn->channel_cache, channel->id);
-      silc_free(channel->channel_name);
-      silc_free(channel->id);
-      silc_free(channel->key);
-      silc_cipher_free(channel->channel_key);
-      silc_free(channel);
+      silc_client_del_channel(client, conn, channel);
+    } else {
+      chu = silc_client_on_channel(channel, client_entry);
+      if (chu) {
+       silc_hash_table_del(client_entry->channels, channel);
+       silc_hash_table_del(channel->user_list, client_entry);
+       silc_free(chu);
+      }
     }
     break;
 
index 65ef13380bbf3194193cf07dcd3c965ef6e987e7..a23d6aca8f565cb77678c15f2ab0761587f8f3b1 100644 (file)
@@ -108,17 +108,16 @@ SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
   cache = silc_calloc(1, sizeof(*cache));
   if (!cache)
     return NULL;
-  cache->id_table = silc_hash_table_alloc(count, silc_hash_id, 
+  cache->id_table = silc_hash_table_alloc(count, silc_hash_id,
                                          (void *)(SilcUInt32)id_type,
-                                         silc_hash_id_compare, 
-                                         (void *)(SilcUInt32)id_type, 
-                                         silc_idcache_destructor, NULL, 
-                                         FALSE);
+                                         silc_hash_id_compare,
+                                         (void *)(SilcUInt32)id_type,
+                                         silc_idcache_destructor, NULL, TRUE);
   cache->name_table = silc_hash_table_alloc(count, silc_hash_string, NULL,
-                                           silc_hash_string_compare, NULL, 
-                                           NULL, NULL, FALSE);
+                                           silc_hash_string_compare, NULL,
+                                           NULL, NULL, TRUE);
   cache->context_table = silc_hash_table_alloc(count, silc_hash_ptr, NULL,
-                                              NULL, NULL, NULL, NULL, FALSE);
+                                              NULL, NULL, NULL, NULL, TRUE);
   cache->destructor = destructor;
   cache->type = id_type;
 
@@ -179,14 +178,6 @@ bool silc_idcache_add(SilcIDCache cache, char *name, void *id,
   if (context)
     silc_hash_table_add(cache->context_table, context, c);
 
-  /* See whether we have time to rehash the tables */
-  if ((silc_hash_table_count(cache->id_table) / 2) >
-      silc_hash_table_size(cache->id_table)) {
-    silc_hash_table_rehash(cache->id_table, 0);
-    silc_hash_table_rehash(cache->name_table, 0);
-    silc_hash_table_rehash(cache->context_table, 0);
-  }
-
   if (ret)
     *ret = c;