From: Pekka Riikonen Date: Tue, 10 Feb 2004 16:29:10 +0000 (+0000) Subject: Command reply fixes. X-Git-Tag: silc.server.0.9.17~31 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=7bf9ca1ffd06dd977db08d377070c8e9b55bda06 Command reply fixes. --- diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 265dead7..bb56e807 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -1866,9 +1866,11 @@ static void silc_server_command_join_channel(SilcServer server, &resolve); if (!client) { if (!resolve || cmd->pending) { - silc_server_command_send_status_reply( + tmp = silc_argument_get_arg_type(cmd->args, 2, &tmp_len); + silc_server_command_send_status_data( cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, 0); + SILC_STATUS_ERR_NO_SUCH_CLIENT_ID, 0, + 2, tmp, tmp_len); goto out; } @@ -1979,9 +1981,6 @@ static void silc_server_command_join_channel(SilcServer server, cmd->sock->hostname, strlen(cmd->sock->hostname)); } - SILC_LOG_DEBUG(("check : %s", check)); - SILC_LOG_DEBUG(("check2: %s", check2)); - /* Check invite list if channel is invite-only channel */ if (channel->mode & SILC_CHANNEL_MODE_INVITE) { if (!channel->invite_list || @@ -2323,15 +2322,15 @@ SILC_SERVER_CMD_FUNC(join) tmp = silc_argument_get_arg_type(cmd->args, 2, &tmp_len); if (!tmp) { silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, + SILC_STATUS_ERR_NO_CLIENT_ID, 0); goto out; } client_id = silc_id_payload_parse_id(tmp, tmp_len, NULL); if (!client_id) { - silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, - 0); + silc_server_command_send_status_data(cmd, SILC_COMMAND_JOIN, + SILC_STATUS_ERR_BAD_CLIENT_ID, 0, + 2, tmp, tmp_len); goto out; } diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index 4e3d0a07..8e545578 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2003 Pekka Riikonen + Copyright (C) 1997 - 2004 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -119,6 +119,7 @@ silc_server_remove_clients_channels(SilcServer server, silc_hash_table_add(channels, channel, channel); } silc_hash_table_list_reset(&htl); + assert(!silc_hash_table_count(client->channels)); } /* This function removes all client entries that are originated from @@ -1024,6 +1025,7 @@ bool silc_server_channel_delete(SilcServer server, /* Totally delete the channel and all users on the channel. The users are deleted automatically in silc_idlist_del_channel. */ + channel->disabled = TRUE; silc_schedule_task_del_by_context(server->schedule, channel->rekey); if (silc_idlist_del_channel(server->local_list, channel)) { server->stat.my_channels--;