From 5491554d589a209d7e565ef0574a7053daa13918 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 11 Mar 2001 18:46:26 +0000 Subject: [PATCH] updates. --- CHANGES | 5 +++++ apps/silcd/command.c | 10 +++++----- lib/silcclient/command_reply.c | 20 ++++++++++++-------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 9870d7c4..5e0f9021 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Sun Mar 11 20:25:06 EET 2001 Pekka Riikonen + + * Fixed a minor bug if WHOIS and IDENTIFY command parsing that + just surfaced after chaning the JOIN procedure. + Sun Mar 11 14:59:05 EET 2001 Pekka Riikonen * Added silc_client_get_clients_by_list to get client entries diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 2850f39d..0b06c10b 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -392,9 +392,9 @@ silc_server_command_whois_parse(SilcServerCommandContext cmd, *client_id_count = 1; /* Take all ID's from the command packet */ - if (argc > 3) { - for (k = 1, i = 4; i < argc + 1; i++) { - tmp = silc_argument_get_arg_type(cmd->args, i, &len); + if (argc > 1) { + for (k = 1, i = 1; i < argc; i++) { + tmp = silc_argument_get_arg_type(cmd->args, i + 3, &len); if (tmp) { *client_id = silc_realloc(*client_id, sizeof(**client_id) * (*client_id_count + 1)); @@ -948,7 +948,7 @@ silc_server_command_identify_send_reply(SilcServerCommandContext cmd, if (!entry->username) { packet = silc_command_reply_payload_encode_va(SILC_COMMAND_IDENTIFY, - SILC_STATUS_OK, ident, 2, + status, ident, 2, 2, idp->data, idp->len, 3, nh, strlen(nh)); } else { @@ -961,7 +961,7 @@ silc_server_command_identify_send_reply(SilcServerCommandContext cmd, } packet = silc_command_reply_payload_encode_va(SILC_COMMAND_IDENTIFY, - SILC_STATUS_OK, ident, 3, + status, ident, 3, 2, idp->data, idp->len, 3, nh, strlen(nh), 4, uh, strlen(uh)); diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index 71f55a9a..b58d690b 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -386,7 +386,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify) tmp = silc_argument_get_arg_type(cmd->args, 1, NULL); SILC_GET16_MSB(status, tmp); - if (status != SILC_STATUS_OK) { + if (status != SILC_STATUS_OK && + status != SILC_STATUS_LIST_START && + status != SILC_STATUS_LIST_ITEM && + status != SILC_STATUS_LIST_END) { if (status == SILC_STATUS_ERR_NO_SUCH_NICK) { /* Take nickname which may be provided */ tmp = silc_argument_get_arg_type(cmd->args, 3, NULL); @@ -407,7 +410,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify) } /* Display one whois reply */ - if (status == SILC_STATUS_OK) { + if (status == SILC_STATUS_OK || + status == SILC_STATUS_LIST_START || + status == SILC_STATUS_LIST_ITEM || + status == SILC_STATUS_LIST_END) { unsigned int len; unsigned char *id_data; char *nickname; @@ -458,12 +464,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify) } } - if (status == SILC_STATUS_LIST_START) { - - } - - if (status == SILC_STATUS_LIST_END) { - + if (status != SILC_STATUS_OK && + status != SILC_STATUS_LIST_END) { + silc_client_command_reply_free(cmd); + return; } /* Execute any pending command callbacks */ -- 2.43.0