From be0c7ce1a309642e9bc96167faacab832b69f976 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 15 Nov 2007 16:09:26 +0000 Subject: [PATCH] Reprocess JOIN command synchronously after resolving channel user list. In JOIN command reply check if the channel key is already saved. If it is we have received new key from server while resolving user and must not save the old key. --- CHANGES | 12 +++++++++++- lib/silcclient/command_reply.c | 11 ++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 55db593e..36a87acd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,14 @@ -Tue Nov 13 18:24:56 EET 2007 Pekka Riikonen +Thu Nov 15 18:03:53 EET 2007 Pekka Riikonen + + * Reprocess JOIN command synchronously after resolving channel + user list. Affected file is lib/silcclient/command_reply.c. + + * In JOIN command reply check if the channel key is already + saved. If it is we have received new key from server while + resolving user and must not save the old key. Affected file + is lib/silcclient/command_reply.c. + +Tue Nov 13 18:24:56 EET 2007 Pekka Riikonen * Added missing channel unreferencing in CMODE, CUMODE, TOPIC, INVITE, BAN and KICK command replies. Affected diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index a4f34ffd..2fec85c6 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -1115,7 +1115,7 @@ silc_client_command_reply_join_resolved(SilcClient client, channel->internal.resolve_cmd_ident = 0; silc_client_unref_channel(client, conn, channel); - SILC_FSM_CALL_CONTINUE(&cmd->thread); + SILC_FSM_CALL_CONTINUE_SYNC(&cmd->thread); } @@ -1265,8 +1265,13 @@ SILC_FSM_STATE(silc_client_command_reply_join) /* Get channel key and save it */ tmp = silc_argument_get_arg_type(args, 7, &len); if (tmp) { - silc_buffer_set(&keyp, tmp, len); - silc_client_save_channel_key(client, conn, &keyp, channel); + /* If channel key already exists on the channel then while resolving + the user list we have already received new key from server. Don't + replace it with this old key. */ + if (!channel->internal.send_key) { + silc_buffer_set(&keyp, tmp, len); + silc_client_save_channel_key(client, conn, &keyp, channel); + } } /* Get topic */ -- 2.24.0