Merged silc_1_1_branch to trunk.
[silc.git] / lib / silcclient / command_reply.c
index 9dda29d38e2c4839010a932b86c66e74c48566ee..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;
 
@@ -221,7 +221,7 @@ SILC_FSM_STATE(silc_client_command_reply_wait)
   /** Wait for command reply */
   silc_fsm_set_state_context(fsm, NULL);
   silc_fsm_next_later(fsm, silc_client_command_reply_timeout,
-                     cmd->cmd != SILC_COMMAND_PING ? 25 : 60, 0);
+                     cmd->cmd != SILC_COMMAND_PING ? 40 : 60, 0);
   return SILC_FSM_WAIT;
 }
 
@@ -677,7 +677,8 @@ SILC_FSM_STATE(silc_client_command_reply_identify)
     }
 
     /* Notify application */
-    silc_client_command_callback(cmd, channel_entry, name, info);
+    silc_client_command_callback(cmd, channel_entry,
+                                channel_entry->channel_name, info);
     silc_client_unref_channel(client, conn, channel_entry);
     break;
   }
@@ -732,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;
   }
 
@@ -800,7 +802,8 @@ SILC_FSM_STATE(silc_client_command_reply_list)
   }
 
   /* Notify application */
-  silc_client_command_callback(cmd, channel_entry, name, topic, usercount);
+  silc_client_command_callback(cmd, channel_entry, channel_entry->channel_name,
+                              topic, usercount);
 
  out:
   silc_client_unref_channel(client, conn, channel_entry);
@@ -1302,7 +1305,7 @@ SILC_FSM_STATE(silc_client_command_reply_join)
   silc_hash_table_list(channel->user_list, &htl);
 
   /* Notify application */
-  silc_client_command_callback(cmd, channel_name, channel, mode, &htl,
+  silc_client_command_callback(cmd, channel->channel_name, channel, mode, &htl,
                               topic, cipher, hmac, channel->founder_key,
                               channel->channel_pubkeys, channel->user_limit);
 
@@ -1945,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);