Fixed USERS command rely rwlock unlocking, which was missing.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 18 Jun 2007 21:05:01 +0000 (21:05 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 18 Jun 2007 21:05:01 +0000 (21:05 +0000)
CHANGES
lib/silcclient/command_reply.c

diff --git a/CHANGES b/CHANGES
index a456045e9167c7327c7457ca1633666d5bb5e467..fa5914133b070f8168383a35cf68668cfc1d5352 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,14 @@
+Mon Jun 18 23:47:22 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Use SILC_VERIFY to assert that silc_rwlock_wrlock can be
+         called only once per thread on Unix.  Affected file is
+         lib/silcutil/unix/silcunixthread.c.  Added same for mutex
+         as well.   Documented same on the API in 
+         lib/silcutil/silcmutex.h.
+
+       * Fixed USERS command reply write-lock unlocking.  Affected file
+         is lib/silcclient/command_reply.c.
+
 Mon Jun 18 08:14:26 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed silc_create_key_pair to check for valid identifier.
index 3c0f56a88995527008a07b4c9b16c2daf88a6aea..61e4d73a082dea7df0a86f0d6791a9576612b313 100644 (file)
@@ -127,7 +127,7 @@ static void silc_client_command_process_error(SilcClientCommandContext cmd,
   if (cmd->error == SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID) {
     SilcChannelEntry channel;
 
-    /* Remove unknown client entry from cache */
+    /* Remove unknown channel entry from cache */
     if (!silc_argument_get_decoded(args, 2, SILC_ARGUMENT_ID, &id, NULL))
       return;
 
@@ -143,7 +143,7 @@ static void silc_client_command_process_error(SilcClientCommandContext cmd,
   if (cmd->error == SILC_STATUS_ERR_NO_SUCH_SERVER_ID) {
     SilcServerEntry server_entry;
 
-    /* Remove unknown client entry from cache */
+    /* Remove unknown server entry from cache */
     if (!silc_argument_get_decoded(args, 2, SILC_ARGUMENT_ID, &id, NULL))
       return;
 
@@ -733,6 +733,7 @@ SILC_FSM_STATE(silc_client_command_reply_nick)
   if (!silc_client_change_nickname(client, conn, conn->local_entry,
                                   nick, &id.u.client_id, idp, idp_len)) {
     ERROR_CALLBACK(SILC_STATUS_ERR_BAD_NICKNAME);
+    silc_rwlock_unlock(conn->local_entry->internal.lock);
     goto out;
   }
 
@@ -1947,6 +1948,8 @@ SILC_FSM_STATE(silc_client_command_reply_users)
     }
   }
 
+  silc_rwlock_unlock(channel->internal.lock);
+
   /* Notify application */
   silc_hash_table_list(channel->user_list, &htl);
   silc_client_command_callback(cmd, channel, &htl);